https://github.com/softonic/laravel-database-migrate-test-listener
Laravel database migrate test listener
https://github.com/softonic/laravel-database-migrate-test-listener
laravel listener migrations phpunit testing
Last synced: 4 months ago
JSON representation
Laravel database migrate test listener
- Host: GitHub
- URL: https://github.com/softonic/laravel-database-migrate-test-listener
- Owner: softonic
- License: other
- Archived: true
- Created: 2019-07-23T10:45:44.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-10-04T08:09:36.000Z (over 2 years ago)
- Last Synced: 2024-12-18T06:39:52.959Z (5 months ago)
- Topics: laravel, listener, migrations, phpunit, testing
- Language: PHP
- Homepage:
- Size: 15.6 KB
- Stars: 1
- Watchers: 14
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
PHPUnit listener to run Laravel database migrations before each testsuite
=====[](https://github.com/softonic/laravel-database-migrate-test-listener/releases)
[](LICENSE.md)
[](https://travis-ci.org/softonic/laravel-database-migrate-test-listener)
[](https://scrutinizer-ci.com/g/softonic/laravel-database-migrate-test-listener/code-structure)
[](https://scrutinizer-ci.com/g/softonic/laravel-database-migrate-test-listener)
[](https://packagist.org/packages/softonic/laravel-database-migrate-test-listener)
[](http://isitmaintained.com/project/softonic/laravel-database-migrate-test-listener "Average time to resolve an issue")
[](http://isitmaintained.com/project/softonic/laravel-database-migrate-test-listener "Percentage of issues still open")This PHPUnit listener run Laravel migrations before each testsuit
Installation
-------Via composer:
```
composer require --dev softonic/laravel-database-migrate-test-listener
```Documentation
-------To use the listener add it to your phpunit.xml, defining on which test suites it should be activated, if it should seed data and the database connection to use.
```
...
Feature
Integration
1
sqlite
>App\\Database\\Seeds\\Foo\\DatabaseSeeder
...```
From now on before the specified test suite is run, the `migrate:fresh` Laravel command will be executed.
Testing
-------`softonic/laravel-database-migrate-test-listener` has a [PHPUnit](https://phpunit.de) test suite and a coding style compliance test suite using [PHP CS Fixer](http://cs.sensiolabs.org/).
To run the tests, run the following command from the project folder.
``` bash
$ docker-compose run test
```License
-------The Apache 2.0 license. Please see [LICENSE](LICENSE) for more information.
[PSR-2]: http://www.php-fig.org/psr/psr-2/
[PSR-4]: http://www.php-fig.org/psr/psr-4/