LiipFunctionalTestBundle
LiipFunctionalTestBundle copied to clipboard
Use cache_db with paratest or fastest?
Is it possible to do it? I tried without adding the path to the sqlite database but it didn't work as expected:
SQLSTATE[HY000]: General error: 11 database disk image is malformed"). (500 Internal Server Error)
Maybe it's related to my other issue about cache_db and memory filesystem?
Thanks.
Nevermind I got it working with fastest:
parameters:
doctrine.dbal.connection_factory.class: Liuggio\Fastest\Doctrine\DBAL\ConnectionFactory
framework:
test: ~
session:
storage_id: session.storage.mock_file
name: MOCKSESSION
profiler:
collect: false
web_profiler:
toolbar: false
intercept_redirects: false
swiftmailer:
disable_delivery: true
liip_functional_test:
cache_db:
sqlite: liip_functional_test.services_database_backup.sqlite
doctrine:
dbal:
default_connection: default
connections:
default:
driver: pdo_sqlite
path: "%kernel.cache_dir%/__DBNAME__.db"
With this command:
find tests -name "*Test.php" | ./vendor/liuggio/fastest/fastest "./vendor/bin/simple-phpunit {};"
Paratest has the following problems:
- compatibility error
PHP Fatal error: Declaration of Symfony\Bridge\PhpUnit\Legacy\SymfonyTestsListenerForV7::addError(PHPUnit\Framework\Test $test, Throwable $t, float $time): void must be compatible with PHPUnit\Framework\TestListener::addError(PHPUnit\Framework\Test $test, Exception $e, $time) in /mysite/vendor/symfony/phpunit-bridge/Legacy/SymfonyTestsListenerForV7.php on line 27
- The paratest:run doesn't run in test env, I had to specify it and it just generates a bunch of db without running the suite:
sf paratest:run --env=test
Cleaning old dbs in /mysite/var/cache/test ...
Creating Schema in /mysite/var/cache/test ...
!
! [CAUTION] This operation should not be executed in a production environment!
!
Creating database schema...
[OK] Database schema created successfully!
Hello! Any news on this matter? Unfortunately it's impossible to get paratest working. This is my command:
./vendor/bin/paratest -p8 --functional --phpunit='./vendor/bin/simple-phpunit'
(Symfony 3.4)
Thanks!
We dropped the support of paratest in #560