Skip to content

Latest commit

 

History

History
69 lines (45 loc) · 1.92 KB

caveats.md

File metadata and controls

69 lines (45 loc) · 1.92 KB

Caveats

Conflicts

DAMADoctrineTestBundle

Due to conflicting operations with databases, this bundle can trigger the following error with DAMADoctrineTestBundle:

Doctrine\DBAL\Driver\PDOException: SQLSTATE[42000]: Syntax error or access violation: 1305 SAVEPOINT DOCTRINE2_SAVEPOINT_2 does not exist

To avoid this, disable automatic changes to database and schema:

# config/packages/test/liip_fixtures.yaml
liip_test_fixtures:
    keep_database_and_schema: true

You'll have to create database and update schema before running your tests on local environment or CI.

[Semantical Error] The annotation "@…" in method …::test…() was never imported

See this solution.

« Examples

Operation 'AbstractPlatform::getListDatabasesSQL' is not supported by platform

This can be caused by sentry/sentry-symfony which decorates the database connection layer.

Disable sentry in the test environment to avoid this issue:

# config/packages/test/sentry.yaml
sentry:
    tracing:
        enabled: false

You have requested a non-existent service "Liip\TestFixturesBundle\Services\DatabaseToolCollection"

Check that the parameter framework.test is enabled:

Symfony 4 and 5:

# config/package/test/framework.yaml
framework:
    test: true

Symfony 6:

# config/package/framework.yaml
when@test:
    framework:
        test: true

LogicException: […] the kernel should only be booted once.

Complete error message:

LogicException: Booting the kernel before calling "Symfony\Bundle\FrameworkBundle\Test\WebTestCase::createClient()" is not supported, the kernel should only be booted once.

Solution: Call self::ensureKernelShutdown(); before creating the client.