Bolt\Tests\Nut\ExtensionsDumpAutoloadTest::testRun PHP Метод

testRun() публичный Метод

public testRun ( )
    public function testRun()
    {
        $app = $this->getApp();
        $app['extend.action.options']->set('optimize-autoloader', true);
        $runner = $this->getMockBuilder(PackageManager::class)->setMethods(['dumpAuoloader'])->setConstructorArgs([$app])->getMock();
        $runner->expects($this->any())->method('dumpAuoloader')->will($this->returnValue(0));
        $app['extend.manager'] = $runner;
        $command = new ExtensionsDumpAutoload($app);
        $tester = new CommandTester($command);
        $tester->execute([]);
        $result = $tester->getDisplay();
        $this->assertRegExp('/Rebuilding autoloaders… \\[DONE\\]/', $result);
        $this->assertRegExp('/Generating optimized autoload files/', $result);
        $this->assertRegExp('/PackageEventListener::dump/', $result);
    }
ExtensionsDumpAutoloadTest