Skip to content

Commit

Permalink
Merge pull request #284 from alexislefebvre/chore-remove-annotations-…
Browse files Browse the repository at this point in the history
…2-3.x

[3.x] chore: remove annotations (2)
  • Loading branch information
alexislefebvre authored Mar 10, 2024
2 parents 81b04bd + cb97437 commit 6ac2a67
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 15 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,7 @@ jobs:
run: echo '127.0.0.1 mariadb postgres mongodb' | sudo tee -a /etc/hosts

- name: Run tests
# In phpunit.xml.dist, tests annotated with "@group mysql" are excluded, revert this
# Run tests twice to ensure that tests are idempotent even if database caching is enabled
run: |
php ./vendor/bin/phpunit --testdox --exclude-group ""
php ./vendor/bin/phpunit --testdox --exclude-group ""
php ./vendor/bin/phpunit --testdox
php ./vendor/bin/phpunit --testdox
16 changes: 15 additions & 1 deletion doc/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,24 @@ Install the dependencies with composer:
docker-compose exec php-fpm composer install
```

Install the lowest dependencies with composer:

```bash
docker-compose exec php-fpm composer update --prefer-lowest
```

Now you can execute the tests with the following command:

```bash
docker-compose exec php-fpm ./vendor/bin/phpunit --exclude-group ""
docker-compose exec php-fpm ./vendor/bin/phpunit
```

## Delete the cache

If you change the version of PHP or dependencies, the caches may cause issues, they can be deleted:

```bash
docker-compose exec php-fpm bash -c "rm -rf tests/App*/var/cache/*"
```

## Apply changes suggested by PHP-CS-Fixer
Expand Down
4 changes: 1 addition & 3 deletions tests/Test/ConfigMysqlCacheDbTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

use Liip\Acme\Tests\App\Entity\User;
use Liip\Acme\Tests\AppConfigMysqlCacheDb\AppConfigMysqlKernelCacheDb;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\PreserveGlobalState;

/**
Expand All @@ -25,8 +24,7 @@
* they are disabled by default (see phpunit.xml.dist).
*
* In order to run them, you have to set the MySQL connection
* parameters in the Tests/AppConfigMysql/config.yml file and
* add “--exclude-group ""” when running PHPUnit.
* parameters in the Tests/AppConfigMysql/config.yml file.
*
* Use Tests/AppConfigMysql/AppConfigMysqlKernelCacheDb.php instead of
* Tests/App/AppKernel.php.
Expand Down
3 changes: 1 addition & 2 deletions tests/Test/ConfigMysqlKeepDatabaseAndSchemaTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
* they are disabled by default (see phpunit.xml.dist).
*
* In order to run them, you have to set the MySQL connection
* parameters in the Tests/AppConfigMysql/config.yml file and
* add “--exclude-group ""” when running PHPUnit.
* parameters in the Tests/AppConfigMysql/config.yml file.
*
* Use Tests/AppConfigMysqlKeepDatabaseAndSchema/AppConfigMysqlKernelKeepDatabaseAndSchema.php instead of
* Tests/App/AppKernel.php.
Expand Down
3 changes: 1 addition & 2 deletions tests/Test/ConfigMysqlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ class_alias('\Doctrine\Persistence\ObjectManager', '\Doctrine\Common\Persistence
* they are disabled by default (see phpunit.xml.dist).
*
* In order to run them, you have to set the MySQL connection
* parameters in the Tests/AppConfigMysql/config.yml file and
* add “--exclude-group ""” when running PHPUnit.
* parameters in the Tests/AppConfigMysql/config.yml file.
*
* Use Tests/AppConfigMysql/AppConfigMysqlKernel.php instead of
* Tests/App/AppKernel.php.
Expand Down
3 changes: 1 addition & 2 deletions tests/Test/ConfigMysqlUrlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
* they are disabled by default (see phpunit.xml.dist).
*
* In order to run them, you have to set the MySQL connection
* parameters in the Tests/AppConfigMysql/config.yml file and
* add “--exclude-group ""” when running PHPUnit.
* parameters in the Tests/AppConfigMysql/config.yml file.
*
* Use Tests/AppConfigMysql/AppConfigMysqlUrlKernel.php instead of
* Tests/App/AppKernel.php.
Expand Down
3 changes: 1 addition & 2 deletions tests/Test/ConfigPgsqlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
* they are disabled by default (see phpunit.xml.dist).
*
* In order to run them, you have to set the PostgreSQL connection
* parameters in the Tests/AppConfigPgsql/config.yml file and
* add “--exclude-group ""” when running PHPUnit.
* parameters in the Tests/AppConfigPgsql/config.yml file.
*
* Use Tests/AppConfigPgsql/AppConfigPgsqlKernel.php instead of
* Tests/App/AppKernel.php.
Expand Down

0 comments on commit 6ac2a67

Please sign in to comment.