TestCase.php 1.07 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
<?php

class TestCase extends Orchestra\Testbench\TestCase {

    /**
     * Get package providers.
     *
     * @return array
     */
    protected function getPackageProviders()
    {
        return array('Jenssegers\Mongodb\MongodbServiceProvider');
    }

    /**
     * Define environment setup.
     *
     * @param  Illuminate\Foundation\Application    $app
     * @return void
     */
    protected function getEnvironmentSetUp($app)
    {
        // reset base path to point to our package's src directory
        //$app['path.base'] = __DIR__ . '/../src';

        // load custom config
        $config = require 'config/database.php';

        // set mongodb as default connection
        $app['config']->set('database.default', 'mongodb');

        // overwrite database configuration
        $app['config']->set('database.connections.mysql', $config['connections']['mysql']);
        $app['config']->set('database.connections.mongodb', $config['connections']['mongodb']);
35 36 37

        // overwrite cache configuration
        $app['config']->set('cache.driver', 'array');
38 39 40
    }

}