本文整理汇总了PHP中FunctionalTester::runCommand方法的典型用法代码示例。如果您正苦于以下问题:PHP FunctionalTester::runCommand方法的具体用法?PHP FunctionalTester::runCommand怎么用?PHP FunctionalTester::runCommand使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FunctionalTester
的用法示例。
在下文中一共展示了FunctionalTester::runCommand方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getNoErrorWithTwigUnknownsIfIgnoring
public function getNoErrorWithTwigUnknownsIfIgnoring(FunctionalTester $I)
{
$I->bootKernelWith('unknowns_suppress');
$I->runCommand('maba_webpack.command.setup');
$I->runCommand('maba_webpack.command.compile');
$I->seeCommandStatusCode(0);
}
示例2: getNoErrorIfAssetsAreDumped
public function getNoErrorIfAssetsAreDumped(FunctionalTester $I)
{
$I->bootKernelWith('customized');
$I->runCommand('maba_webpack.command.setup');
$I->seeFileFound(__DIR__ . '/Fixtures/package.json');
$I->seeFileFound(__DIR__ . '/Fixtures/app/config/webpack.config.js');
$I->runCommand('maba_webpack.command.compile');
$I->seeCommandStatusCode(0);
$I->seeInCommandDisplay('webpack');
$I->dontSeeInCommandDisplay('error');
$I->amOnPage('/customized');
$I->canSeeResponseCodeIs(200);
$I->dontSee('Manifest file not found');
$I->seeInSource('<link rel="stylesheet" id="css1" href="/assets/');
$href = $I->grabAttributeFrom('link#css1', 'href');
preg_match('#/assets/(.*)#', $href, $matches);
$I->seeFileFound(__DIR__ . '/Fixtures/web/assets/' . $matches[1]);
$I->openFile(__DIR__ . '/Fixtures/web/assets/' . $matches[1]);
$I->canSeeInThisFile('.green');
$I->canSeeInThisFile('.red');
$I->canSeeInThisFile('-ms-fullscreen a.css');
$I->amGoingTo('Check if less file was compiled');
$I->canSeeInThisFile('color: #123456');
$I->canSeeInThisFile('-ms-fullscreen a.less');
$I->amGoingTo('Check if sass file was compiled');
$I->canSeeInThisFile('color: #654321');
$I->canSeeInThisFile('-ms-fullscreen a.scss');
$I->amGoingTo('Check if cat.png was included');
$I->canSeeInThisFile('background: url(/assets/');
$I->seeInSource('<link rel="stylesheet" id="css2" href="/assets/');
$href = $I->grabAttributeFrom('link#css2', 'href');
preg_match('#/assets/(.*)#', $href, $matches);
$I->seeFileFound(__DIR__ . '/Fixtures/web/assets/' . $matches[1]);
$I->openFile(__DIR__ . '/Fixtures/web/assets/' . $matches[1]);
$I->canSeeInThisFile('color: #123456');
$I->seeInSource('<script src="/assets/');
$src = $I->grabAttributeFrom('script', 'src');
preg_match('#/assets/(.*)#', $src, $matches);
$I->seeFileFound(__DIR__ . '/Fixtures/web/assets/' . $matches[1]);
$I->openFile(__DIR__ . '/Fixtures/web/assets/' . $matches[1]);
$I->canSeeInThisFile('additional-asset-content');
$I->canSeeInThisFile('additional asset B');
$I->canSeeInThisFile('app-asset-content');
$I->dontSeeInThisFile('featureA-content');
$I->dontSeeInThisFile('featureB-content');
$I->seeInSource('<img src="/assets/');
$src = $I->grabAttributeFrom('img', 'src');
preg_match('#/assets/(.*)#', $src, $matches);
$I->seeFileFound(__DIR__ . '/Fixtures/web/assets/' . $matches[1]);
$I->seeFileIsSmallerThan(__DIR__ . '/Fixtures/web/assets/' . $matches[1], __DIR__ . '/Fixtures/src/Resources/assets/cat.png');
}
示例3: getNoErrorIfAssetsAreDumped
public function getNoErrorIfAssetsAreDumped(FunctionalTester $I)
{
$I->bootKernelWith('tags');
$I->runCommand('maba_webpack.command.setup');
$I->seeFileFound(__DIR__ . '/Fixtures/package.json');
$I->seeFileFound(__DIR__ . '/Fixtures/app/config/webpack.config.js');
$I->runCommand('maba_webpack.command.compile');
$I->seeCommandStatusCode(0);
$I->seeInCommandDisplay('webpack');
$I->dontSeeInCommandDisplay('error');
$I->amOnPage('/tags');
$I->canSeeResponseCodeIs(200);
$I->dontSee('Manifest file not found');
$I->canSeeNumberOfElements('link[rel=stylesheet]', 3);
$urlList = $I->grabMultiple('link', 'href');
foreach ($urlList as $i => $url) {
preg_match('#/compiled/(.*)#', $url, $matches);
$I->seeFileFound(__DIR__ . '/Fixtures/web/compiled/' . $matches[1]);
$I->openFile(__DIR__ . '/Fixtures/web/compiled/' . $matches[1]);
$I->canSeeInThisFile('.class' . $i . ' {');
}
$I->canSeeNumberOfElements('script', 2);
$urlList = $I->grabMultiple('script', 'src');
foreach ($urlList as $i => $url) {
preg_match('#/compiled/(.*)#', $url, $matches);
$I->seeFileFound(__DIR__ . '/Fixtures/web/compiled/' . $matches[1]);
$I->openFile(__DIR__ . '/Fixtures/web/compiled/' . $matches[1]);
$I->canSeeInThisFile('function f' . $i . '() {');
}
$I->canSeeNumberOfElements('img', 2);
$urlList = $I->grabMultiple('img', 'src');
foreach ($urlList as $i => $url) {
preg_match('#/compiled/(.*)#', $url, $matches);
$I->seeFileFound(__DIR__ . '/Fixtures/web/compiled/' . $matches[1]);
}
}
示例4: FunctionalTester
<?php
const COMMAND_NAME = 'inventory';
$I = new FunctionalTester($scenario);
$I->wantTo('Execute command "inventory"');
$I->amLoggedInAs('test');
$result = $I->runCommand('inventory');
PHPUnit_Framework_Assert::assertEquals(COMMAND_NAME, $result['commandName']);
PHPUnit_Framework_Assert::assertCount(6, $result['data']);
$savedItems = $I->getAllItems();
$I->deleteAllItems();
$result = $I->runCommand('inventory');
PHPUnit_Framework_Assert::assertEquals(COMMAND_NAME, $result['commandName']);
PHPUnit_Framework_Assert::assertFalse(isset($result['data']));
$I->loadAllItems($savedItems);
示例5: FunctionalTester
<?php
$I = new FunctionalTester($scenario);
$I->wantTo('Execute command "move"');
$I->amLoggedInAs('test');
$I->haveNoWaitState();
$I->runCommand('move north');
$result = $I->runCommand('move east');
PHPUnit_Framework_Assert::assertTrue(isset($result['waitstate']));
$I->haveNoWaitState();
$I->runCommand('move east');
$I->haveNoWaitState();
$I->runCommand('move south');
$I->haveNoWaitState();
$I->runCommand('move west');
示例6: FunctionalTester
<?php
$I = new FunctionalTester($scenario);
$I->wantTo('Execute command "obtainWood"');
$I->amLoggedInAs('test');
$I->haveNoWaitState();
$I->teleportToCoordinates(3, 3);
$I->amAtCoordinates(3, 3);
$result = $I->runCommand('obtainWood');
PHPUnit_Framework_Assert::assertEquals(1, $result['data']['obtained']);
PHPUnit_Framework_Assert::assertEquals(9, $result['data']['resources']['wood']);
PHPUnit_Framework_Assert::assertFalse(isset($result['waitstate']));
$result = $I->runCommand('obtainWood');
PHPUnit_Framework_Assert::assertTrue(isset($result['waitstate']));
示例7: FunctionalTester
<?php
const COMMAND_NAME_WEAR = 'wear';
$I = new FunctionalTester($scenario);
$I->wantTo('Execute command "wear"');
$I->amLoggedInAs('test');
$result = $I->runCommand('wear newbie-shirt:body');
PHPUnit_Framework_Assert::assertEquals(COMMAND_NAME_WEAR, $result['commandName']);
$result = $I->runCommand('wear coarse-shirt:body');
PHPUnit_Framework_Assert::assertEquals(COMMAND_NAME_WEAR, $result['commandName']);