Skip to content

Commit

Permalink
fix testing database outside scope of autoload migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagoprz committed Apr 5, 2022
1 parent d5cc3db commit f44d4f9
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"Thiagoprz\\CrudTools\\Tests\\": "tests",
"classmap": [
"tests",
"database"
"database/tests"
]
},
"require": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Database\Factories;
namespace Database\Tests\Factories;

use Illuminate\Database\Eloquent\Factories\Factory;
use Unit\Models\Dummy;
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ public function getEnvironmentSetUp($app)
$app['config']->set('app.debug', true);
$app['config']->set('logging.default', 'daily');
$app['config']->set('logging.channels.daily.path', 'logs/testing.log');
touch(__DIR__ . '/../database/testing.sqlite');
require_once __DIR__ . '/../database/migrations/create_dummy_table.php';
touch(__DIR__ . '/../database/tests/testing.sqlite');
require_once __DIR__ . '/../database/tests/migrations/create_dummy_table.php';
(new \CreateDummyTable)->up();
}

Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Models/Dummy.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Unit\Models;

use Database\Factories\DummyFactory;
use Database\Tests\Factories\DummyFactory;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Thiagoprz\CrudTools\Interfaces\ModelCrudInterface;
Expand Down
2 changes: 1 addition & 1 deletion tests/config/database.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
return [
'sqlite' => [
'driver' => 'sqlite',
'database' => 'database/testing.sqlite',
'database' => 'database/tests/testing.sqlite',
'prefix' => '',
],
];

0 comments on commit f44d4f9

Please sign in to comment.