@@ -630,25 +630,16 @@ public function run(PHPUnit_Framework_TestResult $result = null)
630630 return $ result ;
631631 }
632632
633- // Get hookMethods only if this is a testcase
634- // Otherwise $this->name may look like UnitTest::testMethod (e.g. when using @dataProvider)
635- $ hookMethods = array ();
636- if ($ this ->testCase && class_exists ($ this ->name , false )) {
637- $ hookMethods = PHPUnit_Util_Test::getHookMethods ($ this ->name );
638- }
633+ $ hookMethods = PHPUnit_Util_Test::getHookMethods ($ this ->name );
639634
640635 $ result ->startTestSuite ($ this );
641636
642637 try {
643638 $ this ->setUp ();
644639
645- // Some extensions use test names that are not classes;
646- // The method_exists() triggers an autoload call that causes issues with die()ing autoloaders.
647- if ($ this ->testCase && class_exists ($ this ->name , false )) {
648- foreach ($ hookMethods ['beforeClass ' ] as $ beforeClassMethod ) {
649- if (method_exists ($ this ->name , $ beforeClassMethod )) {
650- call_user_func (array ($ this ->name , $ beforeClassMethod ));
651- }
640+ foreach ($ hookMethods ['beforeClass ' ] as $ beforeClassMethod ) {
641+ if (method_exists ($ this ->name , $ beforeClassMethod )) {
642+ call_user_func (array ($ this ->name , $ beforeClassMethod ));
652643 }
653644 }
654645 } catch (PHPUnit_Framework_SkippedTestSuiteError $ e ) {
@@ -684,13 +675,9 @@ public function run(PHPUnit_Framework_TestResult $result = null)
684675 $ test ->run ($ result );
685676 }
686677
687- // Some extensions use test names that are not classes;
688- // The method_exists() triggers an autoload call that causes issues with die()ing autoloaders.
689- if ($ this ->testCase && class_exists ($ this ->name , false )) {
690- foreach ($ hookMethods ['afterClass ' ] as $ afterClassMethod ) {
691- if (method_exists ($ this ->name , $ afterClassMethod )) {
692- call_user_func (array ($ this ->name , $ afterClassMethod ));
693- }
678+ foreach ($ hookMethods ['afterClass ' ] as $ afterClassMethod ) {
679+ if (method_exists ($ this ->name , $ afterClassMethod )) {
680+ call_user_func (array ($ this ->name , $ afterClassMethod ));
694681 }
695682 }
696683
0 commit comments