To initiate php unit tests with LiipFunctionalTestBundle on the command line.
After going through the usual install and write a few tests, it took me a bit to figure out how to run the phpunit command without running into some type of fixture errors. This is when I figured out that you should upload the schema for a sqlite db to run properly.
Fist install the LiipFunctionalTestBundle:
LinkWrite some tests using said bundle.
Run the doctrine command to generate the schema in the test database:
$ app/console doctrine:schema:create --env=test
- Once the schema is done being generated, run the tests.
$ phpunit -c app/
Note: the tests that load the data fixtures in the setUp() override method will load those fixtures into the test database automatically.
Written by Matthew Harmon
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Php
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#