/** * @beforeClass */ public static function someAnnotatedSetupMethod() { self::$beforeClassWasCalled = true; }
public function testBeforeClassWithDataProviders() { $suite = new PHPUnit_Framework_TestSuite('BeforeClassWithOnlyDataProviderTest'); BeforeClassWithOnlyDataProviderTest::resetProperties(); $suite->run($this->result); $this->assertTrue(BeforeClassWithOnlyDataProviderTest::$setUpBeforeClassWasCalled, 'setUpBeforeClass method was not run.'); $this->assertTrue(BeforeClassWithOnlyDataProviderTest::$beforeClassWasCalled, '@beforeClass method was not run.'); }