freshp / phpunit-webtestcase-fixture-helper
Helps to manage fixtures for test-environment in webtestcases.
1.0.0
2018-03-16 13:16 UTC
Requires
- php: >=7.2
- doctrine/doctrine-fixtures-bundle: ^2.4
- symfony/browser-kit: ^3.4
- symfony/framework-bundle: ^3.4
Requires (Dev)
- tm/tooly-composer-script: ~1.2
This package is auto-updated.
Last update: 2024-12-16 21:06:16 UTC
README
phpunit webtestcase doctrine fixture helper
This package can easily setup database for tests for dev
or test
-environments.
Uses doctrine FixtureInterface
for edge to edge tests.
tasks:
- drop the current database
- create a new blank database for
dev
ortest
environment - migrate by forcing the doctrine schema update
- load all fixtures by given
FixtureInterface
usage
- create a FixtureInterface like the example class
example/Fixtures/DataFixtures/ORM/LoadFixtures.php
- write a test-class like
example/Unit/Route/ExampleRouteTest.php
a extend from the given ApiTestCase - use static access to create the client for example in the
setUpBeforeClass
or thesetUp
methodself::createClientWithDatabaseAndFixtures(new LoadFixtures());