diff --git a/.env.travis b/.env.travis new file mode 100644 index 00000000..3045790a --- /dev/null +++ b/.env.travis @@ -0,0 +1,10 @@ +APP_ENV=testing +APP_KEY=SomeRandomString7 + +DB_CONNECTION=testing +DB_TEST_USERNAME=root +DB_TEST_PASSWORD= + +CACHE_DRIVER=array +SESSION_DRIVER=array +QUEUE_DRIVER=sync \ No newline at end of file diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..4c3c0100 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,13 @@ +language: php + +php: + - 7.0 + - 7.1 + - 7.2 + +before_script: + - cp .env.travis .env + - mysql -e 'create database homestead_test;' + +script: + - vendor/bin/phpunit \ No newline at end of file diff --git a/config/database.php b/config/database.php index cab5d068..a0dcaea2 100644 --- a/config/database.php +++ b/config/database.php @@ -54,6 +54,18 @@ return [ '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' => 'utf8mb4', + 'collation' => 'utf8mb4_unicode_ci', + 'prefix' => '', + 'strict' => false, + ], + 'pgsql' => [ 'driver' => 'pgsql', 'host' => env('DB_HOST', '127.0.0.1'), diff --git a/phpunit.xml b/phpunit.xml index bb9c4a7e..ee184686 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -24,6 +24,7 @@ + diff --git a/tests/Feature/ExampleTest.php b/tests/Feature/ExampleTest.php deleted file mode 100644 index f31e495c..00000000 --- a/tests/Feature/ExampleTest.php +++ /dev/null @@ -1,21 +0,0 @@ -get('/'); - - $response->assertStatus(200); - } -}