Skip to content

Latest commit

 

History

History
38 lines (28 loc) · 811 Bytes

TESTING.md

File metadata and controls

38 lines (28 loc) · 811 Bytes

How to run phpunit tests

For reference: https://propelorm.org/Propel/cookbook/working-with-unit-tests.html

Use separate docker containers to run tests, because this package requires own database to test its functionality.

Build and start containers

docker-compose up

Install dependencies

docker-compose exec php bash -c "composer install"

Prepare test databases

docker-compose exec mysql sh -c "mysql -u root -proot < /var/www/test/init_db.sql"

Prepare tests

docker-compose exec php bash -c "/var/www/test/reset_tests.sh"

Note that getting errors like these is OK:

BUILD FAILED
Propel/generator/build.xml:95:15: No project directory specified

Run tests:

docker-compose exec php bash -c "vendor/bin/phpunit"