Hello all,
I have problems with running mij phpunits for the tables.
I followed the tutorial to create the Articles table, but now i want to unit test it.
If i run the command: vendor/bin/phpunit tests/TestCase/Model/Table/ArticlesTableTest.php
I get the following error:
I created the datasource test with a test database. ( database has been created locally ).
/*
* The test connection is used during the test suite.
*/
'test' => [
'datasource' => 'Cake\Database\Driver\Mysql',
'persistent' => false,
'host' => 'localhost',
'username' => 'root',
'password' => '',
'database' => 'test_cake_learning_local',
],
Inside the phpunit.xml.dist
i have the extension set.
<!-- Load extension for fixtures -->
<extensions>
<bootstrap class="Cake\TestSuite\Fixture\Extension\PHPUnitExtension"/>
</extensions>
I’m a bit lost what this could be, i hope somebody can help me out so i can continue learning!
[EDIT]
Ok, i got it…
In the tutorial there was a plain query to make the tables, so i had no migration file for the ArticlesTable… Glad to have found it!!