/** * @group ZF-6618 */ public function testCanExecuteBoostrapResourceViaApplicationInstanceBootstrapMethod() { $application = new Application\Application('testing', array('bootstrap' => array('path' => __DIR__ . '/TestAsset/ZfAppBootstrap.php', 'class' => 'ZendTest\\Application\\TestAsset\\ZfAppBootstrap'))); $application->bootstrap('foo'); $this->assertEquals(1, $application->getBootstrap()->fooExecuted); $this->assertEquals(0, $application->getBootstrap()->barExecuted); }
/** * @group ZF-8193 */ public function testWhenApplicationObjectUsedAsBootstrapTestCaseShouldExecuteBootstrapRunMethod() { $application = new Application\Application('testing', array('resources' => array('frontcontroller' => array('controllerDirectory' => __DIR__ . '/_files/application/controllers')))); $this->testCase->bootstrap = $application; $this->testCase->bootstrap(); $this->testCase->dispatch('/'); $front = $application->getBootstrap()->getResource('frontcontroller'); $boot = $front->getParam('bootstrap'); $type = is_object($boot) ? get_class($boot) : gettype($boot); $this->assertTrue($boot === $this->testCase->bootstrap->getBootstrap(), $type); }
/** * @group ZF2-38 */ public function testContinueResourceExecutingByModulesResource() { define('APPLICATION_PATH_ZF2_38', __DIR__); $application = new Application\Application('testing', __DIR__ . '/TestAsset/Zf2-38.ini'); $application->bootstrap(); $broker = $application->getBootstrap()->getBroker(); $modulesInitTitme = $broker->load('zf38modules')->getInitTime(); $zf38InitTitme = $broker->load('zf38')->getInitTime(); $this->assertFalse($modulesInitTitme > $zf38InitTitme, 'Modules execute resources before end of their bootstraps'); }