public function getNoErrorIfAssetsAreDumped(FunctionalTester $I) { $I->bootKernelWith(); $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('/'); $I->canSeeResponseCodeIs(200); $I->dontSee('Manifest file not found'); $I->dontSeeInSource('<link rel="stylesheet"'); $I->seeInSource('<script src="http://localhost:8080/compiled/'); $src = $I->grabAttributeFrom('script', 'src'); preg_match('#http://localhost:8080/compiled/(.*)#', $src, $matches); $I->seeFileFound(__DIR__ . '/Fixtures/web/compiled/' . $matches[1]); $I->openFile(__DIR__ . '/Fixtures/web/compiled/' . $matches[1]); $I->canSeeInThisFile('.green'); $I->canSeeInThisFile('.red'); }
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]); } }
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'); }
<?php $I = new FunctionalTester($scenario); $I->wantTo('check application versioning'); $I->dontSeeFileFound('src/version'); $I->seeFileFound('version'); $I->openFile('version'); $I->dontSeeInThisFile('dev'); $I->dontSeeInThisFile('dirty'); $version = file_get_contents('version'); $I->amGoingTo('check version visiblity in modal'); $I->expectTo('see application version ' . $version); $I->amOnPage('/user/security/login'); $I->see($version, '.modal-body');
<?php $outputPath = 'tests/_output/'; $outputFile = 'trustChain.crt'; $outputResult = $outputPath . $outputFile; if (file_exists($outputResult)) { unlink($outputResult); } $command = "php ./ssl-certificate-chain-resolver resolve tests/_data/google.crt " . $outputResult; $I = new FunctionalTester($scenario); $I->wantTo('download intermediate certificates and write them to a file'); $I->runShellCommand($command); $I->seeFileFound($outputFile, $outputPath); $expected = file_get_contents("tests/_data/expectedTrustChain.crt"); $output = file_get_contents($outputResult); $expected = str_replace("\r", "", $expected); $output = str_replace("\r", "", $output); PHPUnit_Framework_Assert::assertEquals($expected, $output);
<?php // @group mandatory $I = new FunctionalTester($scenario); $I->wantTo('check application versioning'); $I->dontSeeFileFound('version'); $I->seeFileFound('src/version'); $I->openFile('src/version'); $I->dontSeeInThisFile('dev'); $I->dontSeeInThisFile('dirty'); $version = file_get_contents('src/version'); $I->amGoingTo('check version visiblity in modal'); $I->expectTo('see application version ' . $version); $I->amOnPage('/user/security/login'); $I->see($version, '.modal-body');
<?php $I = new FunctionalTester($scenario); $I->amGoingTo('check version visiblity'); $I->seeFileFound('/app/version'); $version = file_get_contents('/app/version'); $I->expectTo('see application version ' . $version); $I->amOnPage('/en-us'); $I->see($version);
<?php $I = new FunctionalTester($scenario); $I->wantTo('Check for existance of log files'); $I->seeFileFound('hhvm.access.log', '/var/log/nginx/'); $I->seeFileFound('hhvm.apachestyle.access.log', '/var/log/nginx/'); $I->seeFileFound('hhvm.error.log', '/var/log/nginx/'); $I->seeFileFound('cache.hhvm.access.log', '/var/log/nginx/'); $I->seeFileFound('cache.hhvm.apachestyle.access.log', '/var/log/nginx/'); $I->seeFileFound('cache.hhvm.error.log', '/var/log/nginx/'); $I->wantTo('Check for the absence of legacy log files'); $I->dontSeeFileFound('hhvm-hhvm.access.log', '/var/log/nginx/'); $I->dontSeeFileFound('hhvm-hhvm.apachestyle.access.log', '/var/log/nginx/'); $I->dontSeeFileFound('hhvm-hhvm.error.log', '/var/log/nginx/'); $I->dontSeeFileFound('hhvm-php.access.log', '/var/log/nginx/'); $I->dontSeeFileFound('hhvm-php.apachestyle.access.log', '/var/log/nginx/'); $I->dontSeeFileFound('hhvm-php.error.log', '/var/log/nginx/'); $I->dontSeeFileFound('cache.hhvm-hhvm.access.log', '/var/log/nginx/'); $I->dontSeeFileFound('cache.hhvm-hhvm.apachestyle.access.log', '/var/log/nginx/'); $I->dontSeeFileFound('cache.hhvm-hhvm.error.log', '/var/log/nginx/'); $I->dontSeeFileFound('cache.hhvm-php.access.log', '/var/log/nginx/'); $I->dontSeeFileFound('cache.hhvm-php.apachestyle.access.log', '/var/log/nginx/'); $I->dontSeeFileFound('cache.hhvm-php.error.log', '/var/log/nginx/'); $I->wantTo('Check for existance of nginx config files'); $I->seeFileFound('www-hhvm.conf', '/etc/nginx/'); $I->wantTo('Check for the absence of legacy nginx config files'); $I->dontSeeFileFound('hhvm-hhvm.conf', '/etc/nginx/'); $I->dontSeeFileFound('hhvm-php.conf', '/etc/nginx/'); $I->wantTo('Check for the absence of legacy PimpMyLogs config files'); $I->dontSeeFileFound('hhvm-hhvm.json', '/nas/wp/www/sites/admin/logs/config.user.d/'); $I->dontSeeFileFound('hhvm-php.json', '/nas/wp/www/sites/admin/logs/config.user.d/');