Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/larttyler/symfony-phpunit-helpers
https://github.com/larttyler/symfony-phpunit-helpers
Last synced: 4 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/larttyler/symfony-phpunit-helpers
- Owner: LartTyler
- License: gpl-3.0
- Created: 2017-07-07T13:11:47.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-07-07T16:34:47.000Z (over 7 years ago)
- Last Synced: 2024-05-05T04:21:01.639Z (6 months ago)
- Language: PHP
- Size: 29.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Configuration
Add the following to `app/AppKernel.php`.```php
getEnvironment(), array('dev', 'test'), true)) {
// ...
if ($this->getEnvironment() === 'test') {
$bundles[] = new Liip\FunctionalTestBundle\LiipFunctionalTestBundle();
}
}
return $bundles;
}
// ...
}
```Next, enable the Liip bundle. Additionally, you should also configure Doctrine to use a temporary
SQLite database, in lieu of your normal database connection.```yaml
liip_functional_test:
cache_sqlite_db: true# Optional, but recommended; tells Doctrine to use a temporary SQLite database for testing
doctrine:
dbal:
driver: pdo_sqlite
path: '%kernel.cache_dir%/test.db'
```Please read the [LiipFunctionalTestBundle](https://github.com/liip/LiipFunctionalTestBundle/blob/master/README.md)
documentation for more information on configuring the Liip bundle.## Usage
Simply have your test cases extend from `DaybreakStudios\Utility\SymfonyPHPUnitHelpers\WebTestCase`.```php
client->request('GET', '/home');
$response = $this->client->getResponse();
$this->isSuccessful($response);
}
}
```