Last active
June 8, 2022 13:36
-
-
Save foxted/0f8ed1fcc08fc79741cc to your computer and use it in GitHub Desktop.
Unit test Laravel 4.2 packages in context with Travis CI (with SQLite testing database)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
language: php | |
php: | |
- 5.4 | |
- 5.5 | |
- 5.6 | |
before_install: | |
- composer self-update | |
- composer create-project laravel/laravel | |
- cd ./laravel | |
- composer config repositories.[GITHUB_USERNAME] vcs [GITHUB_HTTPS_CLONE_URL] | |
- composer require [PACKAGE_NAME] dev-master | |
- composer update | |
- touch ./app/database/testing.sqlite | |
- cp ./vendor/[GITHUB_USERNAME]/[GITHUB_PACKAGE]/tests/config/database.php ./app/config/testing/ | |
- cp ./vendor/[GITHUB_USERNAME]/[GITHUB_PACKAGE]/tests/config/app.php ./app/config/testing/ | |
- export APP_ENV="testing" | |
- cd ./vendor/[GITHUB_USERNAME]/[GITHUB_PACKAGE] | |
script: "phpunit" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
return array( | |
'providers' => append_config(array( | |
'Namespace\To\ServiceProvider' | |
)), | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
return array( | |
'default' => 'sqlite', | |
'connections' => array( | |
'sqlite' => array( | |
'driver' => 'sqlite', | |
'database' => __DIR__.'/../../database/testing.sqlite', | |
'prefix' => '', | |
), | |
), | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment