Skip to content

Latest commit

 

History

History
118 lines (78 loc) · 3.07 KB

internals.md

File metadata and controls

118 lines (78 loc) · 3.07 KB

Internals

You can test this package either globally or individually for each DBMS.

GitHub actions

All packages have GitHub actions by default, so you can test your contribution in the cloud.

Note: We recommend pull requesting in draft mode until all tests pass.

Docker images

For greater ease, we recommend to use Docker container for each DBMS. For this, you can use the docker-compose.yml file in the root directory of each package.

To run Docker containers, you can use the following command:

docker compose up -d

Global testing

To run tests, follow these steps.

  1. Install all DBMS dependencies with composer.

    composer require --dev yiisoft/db-mssql yiisoft/db-mysql yiisoft/db-oracle yiisoft/db-pgsql yiisoft/db-sqlite --ansi
  2. Run all Docker containers for each DBMS.

  3. Run the tests.

    vendor/bin/phpunit

Individual testing

To run tests, follow these steps.

  1. Install DBMS dependencies with Composer.

    composer require --dev yiisoft/db-pgsql --ansi
  2. Run the Docker container for the DBMS you want to test.

  3. Run the tests.

    vendor/bin/phpunit --testsuite=Pgsql

Suites available:

  • Mssql
  • Mysql
  • Oracle
  • Pgsql
  • Sqlite

Unit testing

The package is tested with PHPUnit. To run tests:

./vendor/bin/phpunit

Mutation testing

The package tests are checked with Infection mutation framework with Infection Static Analysis Plugin. To run it:

./vendor/bin/roave-infection-static-analysis-plugin

Static analysis

The code is statically analyzed with Psalm. To run static analysis:

./vendor/bin/psalm

Rector

Use Rector to make codebase follow some specific rules or use either newest or any specific version of PHP:

./vendor/bin/rector

Composer require checker

This package uses composer-require-checker to check if all dependencies are correctly defined in composer.json.

To run the checker, execute the following command:

./vendor/bin/composer-require-checker