Skip to content
This repository was archived by the owner on Jun 4, 2024. It is now read-only.
This repository was archived by the owner on Jun 4, 2024. It is now read-only.

Running phpunit second time fails a tests #139

Closed
SOHELAHMED7/yii2-openapi
#20
@SOHELAHMED7

Description

@SOHELAHMED7

If I run ./vendor/bin/phpunit first time after fresh docker-start, all tests passes successfully.

If I run same command second time, all tests passes successfully except one tests\unit\MultiDbSecondaryMigrationTest::testMysql

It is the same issue as in #137

I found that this is caused by:

Few tests (e.g. XDbTypeTest) applies (runUpMigrations()) and revert (runDownMigrations()) migrations

        $this->runUpMigrations('mysql', 4);      <------ this
        Yii::$app->db->schema->refresh();
        $this->runFaker();
        $this->runDownMigrations('mysql', 4); <------ this

Stub: SOHELAHMED7@cef2b0f

This changes the order of the foreign key stored in MySQL internal DBs.

If I don't applies and revert migrations, this test passes


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions