I'm trying to add some phpunit tests for my Symfony project (that also implements the Api Platform). I've installed the Alice Bundle and I've created some fixtures but for some reason when I try to run the command:
php bin/phpunit
It says:
PDOException: SQLSTATE[HY000] [1044] Access denied for user 'user'@'%' to database 'product-db-api_test'
The fixtures were loaded in the database (product-db-api) and I even tried to create a database test but it says there's an error in my query so I guess I cannot add it with that name.
Has anyone encountered this issue? And my test class is like this:
class ProductTest extends ApiTestCase
{
use RefreshDatabaseTrait;
public function testGetAllProducts()
{ // code}
}
And I also tried to add a .env.testing
with the same values as in .env but without luck.