04.
Finishing the Battle
Keep on Learning!
If you liked what you've learned so far, dive in! Subscribe to get access to this tutorial plus video, code and script downloads.
If you liked what you've learned so far, dive in! Subscribe to get access to this tutorial plus video, code and script downloads.
Whoops, an error! Please, try again later.
6 Comments
If anyone is getting an error running this test with the downloaded code, be aware that the jwt_key_pass_phrase needs to be set to happyapi from the last course.
Thanks Agnes! I just updated the
parameters.yml.distfile to use this as the default value... just to help people a bit more. Thanks for the tip on this!Hi,
I'm getting an error, when running `./vendor/bin/phpunit --filter testPOSTCreateBattle`:
There was 1 error:
1) AppBundle\Controller\Api\BattleControllerTest::testPOSTCreateBattle
Doctrine\DBAL\Exception\InvalidFieldNameException: An exception occurred while executing 'INSERT INTO battle_project (name, difficulty_level) VALUES (?, ?)' with params ["my_project", 4]:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'difficulty_level' in 'field list'
the column is certainly there. I have even dropped the database and done the following:
./bin/console doctrine:database:create
./bin/console doctrine:schema:create
and get the same error.
What could be going on?
When I run the query manually, it works fine:
INSERT INTO battle_project (name, difficulty_level) VALUES ("my_project",4)
Sorry, Ryan, I figured it out! I was using the test config (config_test.yml), which had a different database name (suffixed with '_test').
Please delete my comments.
Thank you!
Ha, nice detective work Vlad! It's probably better you figured it out - you won't forget about this in the future :)
"Houston: no signs of life"
Start the conversation!