Skip to content

Instantly share code, notes, and snippets.

@aikchun
Forked from gilbitron/.env.travis
Created July 20, 2016 23:18
Show Gist options
  • Save aikchun/9b4628d6fce61c63301b9131408b8447 to your computer and use it in GitHub Desktop.
Save aikchun/9b4628d6fce61c63301b9131408b8447 to your computer and use it in GitHub Desktop.

Revisions

  1. @gilbitron gilbitron revised this gist Oct 7, 2015. 1 changed file with 29 additions and 0 deletions.
    29 changes: 29 additions & 0 deletions phpunit.xml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,29 @@
    <?xml version="1.0" encoding="UTF-8"?>
    <phpunit backupGlobals="false"
    backupStaticAttributes="false"
    bootstrap="bootstrap/autoload.php"
    colors="true"
    convertErrorsToExceptions="true"
    convertNoticesToExceptions="true"
    convertWarningsToExceptions="true"
    processIsolation="false"
    stopOnFailure="false"
    syntaxCheck="false">
    <testsuites>
    <testsuite name="Application Test Suite">
    <directory>./tests/</directory>
    </testsuite>
    </testsuites>
    <filter>
    <whitelist>
    <directory suffix=".php">app/</directory>
    </whitelist>
    </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"/>
    </php>
    </phpunit>
  2. @gilbitron gilbitron created this gist Oct 7, 2015.
    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
    13 changes: 13 additions & 0 deletions .travis.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    language: php

    php:
    - 5.6

    before_script:
    - cp .env.travis .env
    - mysql -e 'create database homestead_test;'
    - composer self-update
    - composer install --no-interaction

    script:
    - vendor/bin/phpunit
    41 changes: 41 additions & 0 deletions database.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,41 @@
    <?php

    return [

    //...

    'default' => env('DB_CONNECTION', 'mysql'),

    //...

    'connections' => [

    'mysql' => [
    'driver' => 'mysql',
    'host' => env('DB_HOST', 'localhost'),
    'database' => env('DB_DATABASE', 'homestead'),
    'username' => env('DB_USERNAME', 'homestead'),
    'password' => env('DB_PASSWORD', 'secret'),
    'charset' => 'utf8',
    'collation' => 'utf8_unicode_ci',
    'prefix' => '',
    'strict' => false,
    ],

    '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,
    ],

    ],

    //...

    ];