PHP code example of dbstudios / symfony-phpunit-helpers
1. Go to this page and download the library: Download dbstudios/symfony-phpunit-helpers library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
dbstudios / symfony-phpunit-helpers example snippets
// app/AppKernel.php
// ...
class AppKernel extends Kernel {
public function registerBundles() {
// ...
if (in_array($this->getEnvironment(), array('dev', 'test'), true)) {
// ...
if ($this->getEnvironment() === 'test') {
$bundles[] = new Liip\FunctionalTestBundle\LiipFunctionalTestBundle();
}
}
return $bundles;
}
// ...
}
use DaybreakStudios\Utility\SymfonyPHPUntHelpers\WebTestCase;
class MyTestCase extends WebTestCase {
public function testItRespondsSuccessfully() {
$this->client->request('GET', '/home');
$response = $this->client->getResponse();
$this->isSuccessful($response);
}
}