Skip to content

Commit

Permalink
Ajout de la configuration pour Travis
Browse files Browse the repository at this point in the history
  • Loading branch information
Asterodeia committed Oct 14, 2016
1 parent 7e96fb5 commit 2c9d562
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 2 deletions.
10 changes: 10 additions & 0 deletions .env.travis
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
APP_ENV=testing
APP_KEY=SomeRandomString

DB_CONNECTION=testing
DB_TEST_USERNAME=root
DB_TEST_PASSWORD=

CACHE_DRIVER=array
SESSION_DRIVER=array
QUEUE_DRIVER=sync
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
Homestead.json
Homestead.yaml
.env
tests/_intellij*
16 changes: 16 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
language: php

php:
- 5.6

before_script:
- cp .env.travis .env
- mysql -e 'create database homestead_test;'
- composer self-update
- composer install --no-interaction
- php artisan key:generate
- php artisan config:clear
- php artisan migrate:refresh --seed

script:
- vendor/bin/phpunit
12 changes: 12 additions & 0 deletions config/database.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,18 @@
'engine' => null,
],

'testing' => [
'driver' => 'mysql',
'host' => env('DB_TEST_HOST', 'localhost'),
'database' => env('DB_TEST_DATABASE', 'homestead_test'),
'username' => env('DB_TEST_USERNAME', 'homestead'),
'password' => env('DB_TEST_PASSWORD', 'secret'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'strict' => false,
],

'pgsql' => [
'driver' => 'pgsql',
'host' => env('DB_HOST', 'localhost'),
Expand Down
1 change: 1 addition & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
</filter>
<php>
<env name="APP_ENV" value="testing"/>
<env name="DB_CONNECTION" value="testing"/>
<env name="CACHE_DRIVER" value="array"/>
<env name="SESSION_DRIVER" value="array"/>
<env name="QUEUE_DRIVER" value="sync"/>
Expand Down
3 changes: 1 addition & 2 deletions tests/ExampleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ class ExampleTest extends TestCase
*/
public function testBasicExample()
{
$this->visit('/')
->see('Laravel');
$this->assertTrue(true);
}
}

0 comments on commit 2c9d562

Please sign in to comment.