tests and laravel models
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace Laravel5;
|
||||
namespace Tests\Laravel5;
|
||||
|
||||
use Codeception\TestCase\Test;
|
||||
use Aedart\Testing\Laravel\Traits\TestHelperTrait;
|
||||
@@ -9,63 +9,13 @@ use XaiCorp\AbcParser\Models\Laravel5\TuneAttribute;
|
||||
use XaiCorp\AbcParser\Models\Laravel5\TuneSetting;
|
||||
use XaiCorp\AbcParser\Models\Laravel5\TuneSettingAttribute;
|
||||
|
||||
class TuneSettingTest extends Test
|
||||
class TuneSettingTest extends BaseDbTest
|
||||
{
|
||||
use TestHelperTrait;
|
||||
|
||||
/**
|
||||
* @var \UnitTester
|
||||
*/
|
||||
protected $tester;
|
||||
|
||||
/**
|
||||
* Define environment setup.
|
||||
*
|
||||
* @param \Illuminate\Foundation\Application $app
|
||||
* @return void
|
||||
*/
|
||||
protected function getEnvironmentSetUp($app)
|
||||
{
|
||||
// Setup default database to use sqlite :memory:
|
||||
$app['config']->set('database.default', 'testbench');
|
||||
// $app['config']->set('database.connections.testbench', [
|
||||
// 'driver' => 'mysql',
|
||||
// 'host' => 'localhost',
|
||||
// 'database' => 'abc-api-testing',
|
||||
// 'charset' => 'utf8',
|
||||
// 'collation' => 'utf8_unicode_ci',
|
||||
// 'prefix' => '',
|
||||
// 'strict' => true,
|
||||
// 'username' => 'abc-api',
|
||||
// 'password' => 'sio2nf0d'
|
||||
// ]);
|
||||
$app['config']->set('database.connections.testbench', [
|
||||
'driver' => 'sqlite',
|
||||
'database' => ':memory:',
|
||||
'prefix' => '',
|
||||
]);
|
||||
$app->setBasePath(dirname(dirname(dirname(__DIR__))));
|
||||
$Artisan = $app->make('Artisan');
|
||||
$Artisan::call('migrate');
|
||||
}
|
||||
|
||||
|
||||
protected function _before()
|
||||
{
|
||||
$this->startApplication();
|
||||
$db = app()->make('db');
|
||||
$db->beginTransaction();
|
||||
|
||||
$this->withFactories(__DIR__.'/factories');
|
||||
}
|
||||
|
||||
protected function _after()
|
||||
{
|
||||
$db = app()->make('db');
|
||||
$db->rollBack();
|
||||
$this->stopApplication();
|
||||
}
|
||||
|
||||
// tests: trying to...
|
||||
|
||||
public function testMakeModel()
|
||||
|
||||
Reference in New Issue
Block a user