mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-18 10:07:12 +00:00
* Make createLocalViewFactory compatible with Laravel 8 Fixes https://github.com/barryvdh/laravel-ide-helper/issues/1024 * tests: move up mockFilesystem so it get be re-used in other tests Note: removed `$this->mockOutput = '';` as it was a no-op, that property doesn't exist (it was probably a typo, but I guess we don't need it anyway) * tests: show basic features for ide-helper:meta working
61 lines
1.6 KiB
PHP
61 lines
1.6 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand;
|
|
|
|
use Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider;
|
|
use Barryvdh\LaravelIdeHelper\Tests\SnapshotPhpDriver;
|
|
use Barryvdh\LaravelIdeHelper\Tests\TestCase;
|
|
|
|
abstract class AbstractModelsCommand extends TestCase
|
|
{
|
|
protected function setUp(): void
|
|
{
|
|
parent::setUp();
|
|
|
|
$this->loadMigrationsFrom(__DIR__ . '/migrations');
|
|
$this->artisan('migrate');
|
|
$this->mockFilesystem();
|
|
}
|
|
|
|
/**
|
|
* Get package providers.
|
|
*
|
|
* @param \Illuminate\Foundation\Application $app
|
|
*
|
|
* @return array
|
|
*/
|
|
protected function getPackageProviders($app)
|
|
{
|
|
return [IdeHelperServiceProvider::class];
|
|
}
|
|
|
|
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' => '',
|
|
]);
|
|
|
|
// Load the Models from the Test dir
|
|
$config->set('ide-helper.model_locations', [
|
|
dirname((new \ReflectionClass(static::class))->getFileName()) . '/Models',
|
|
]);
|
|
|
|
// Don't override integer -> int for tests
|
|
$config->set('ide-helper.type_overrides', []);
|
|
}
|
|
|
|
protected function assertMatchesMockedSnapshot()
|
|
{
|
|
$this->assertMatchesSnapshot($this->mockFilesystemOutput, new SnapshotPhpDriver());
|
|
}
|
|
}
|