/
githubmirror
/
framework
Обзор
Документация
Войти
/
githubmirror
/
framework
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
13.x
tests/Integration/Database/MigrateWithRealpathTest.php
43 строки
1 KB
Mior Muhammad Zaki
[8.x] Refresh database for integration tests (#39543)
15 ноя 2021, 17:46
Не верифицирован
15 ноя 2021, 17:46
e9f9d98
Код
Авторство
О чём код?
<?php namespace Illuminate\Tests\Integration\Database; use Illuminate\Support\Facades\Schema; use Orchestra\Testbench\TestCase; class MigrateWithRealpathTest extends TestCase { protected function setUp(): void { parent::setUp(); if ($this->app['config']->get('database.default') !== 'testing') { $this->artisan('db:wipe', ['--drop-views' => true]); } $options = [ '--path' => realpath(__DIR__.'/stubs/'), '--realpath' => true, ]; $this->artisan('migrate', $options); $this->beforeApplicationDestroyed(function () use ($options) { $this->artisan('migrate:rollback', $options); }); } public function testRealpathMigrationHasProperlyExecuted() { $this->assertTrue(Schema::hasTable('members')); } public function testMigrationsHasTheMigratedTable() { $this->assertDatabaseHas('migrations', [ 'id' => 1, 'migration' => '2014_10_12_000000_create_members_table', 'batch' => 1, ]); } }