mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-18 18:13:11 +00:00
* tests: add abstract class for all database related tests * tests: add abstract class for all ModelsCommand related tests * tests: add GenerateBasicPhpdoc test * tests: add CustomDate test * tests: remove MITM abstract TestCaseDatabase, not useful here * tests: skip new ModelsCommand test on Laravel < 6 * tests: remove CarbonImmutable checked Since we decided to skip for Laravel < 6.0 anyway, it's always present
38 lines
1001 B
PHP
38 lines
1001 B
PHP
<?php declare(strict_types=1);
|
|
|
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand;
|
|
|
|
use Barryvdh\LaravelIdeHelper\Tests\TestCase;
|
|
use Illuminate\Foundation\Application;
|
|
|
|
abstract class AbstractModelsCommand extends TestCase
|
|
{
|
|
protected function setUp(): void
|
|
{
|
|
parent::setUp();
|
|
|
|
// Skip older Laravel version for these tests
|
|
if (version_compare(Application::VERSION, '6.0', '<')) {
|
|
$this->markTestSkipped('This test requires Laravel 6.0 or higher');
|
|
return;
|
|
}
|
|
|
|
$this->loadMigrationsFrom(__DIR__ . '/migrations');
|
|
$this->artisan('migrate');
|
|
}
|
|
|
|
protected function getEnvironmentSetUp($app)
|
|
{
|
|
parent::getEnvironmentSetUp($app);
|
|
|
|
$config = $app['config'];
|
|
|
|
$config->set('database.default', 'sqlite');
|
|
$config->set('database.connections.sqlite', [
|
|
'driver' => 'sqlite',
|
|
'database' => ':memory:',
|
|
'prefix' => '',
|
|
]);
|
|
}
|
|
}
|