12-05-2026 Frontend dev
This commit is contained in:
parent
405df0a122
commit
5b8bdf4182
779 changed files with 480564 additions and 6241 deletions
38
tests/Feature/LegacyVerifyCommandTest.php
Normal file
38
tests/Feature/LegacyVerifyCommandTest.php
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Tests\TestCase;
|
||||
|
||||
test('legacy verify succeeds for an empty but consistent target database', function () {
|
||||
/** @var TestCase $this */
|
||||
Storage::fake('local');
|
||||
|
||||
$this->artisan('legacy:verify', ['--skip-legacy' => true])
|
||||
->assertSuccessful()
|
||||
->expectsOutputToContain('Legacy-DB-Checks werden übersprungen.')
|
||||
->expectsOutputToContain('OK import_map_targets')
|
||||
->expectsOutputToContain('OK target_foreign_keys');
|
||||
|
||||
expect(Storage::disk('local')->files('migration'))->toHaveCount(1);
|
||||
});
|
||||
|
||||
test('legacy verify fails when an import map points to a missing target row', function () {
|
||||
/** @var TestCase $this */
|
||||
DB::table('legacy_import_map')->insert([
|
||||
'legacy_portal' => 'presseecho',
|
||||
'legacy_table' => 'sf_guard_user',
|
||||
'legacy_id' => 123,
|
||||
'target_table' => 'users',
|
||||
'target_id' => 999_999,
|
||||
'imported_at' => now(),
|
||||
]);
|
||||
|
||||
$this->artisan('legacy:verify', [
|
||||
'--skip-legacy' => true,
|
||||
'--no-report' => true,
|
||||
])
|
||||
->assertExitCode(Command::FAILURE)
|
||||
->expectsOutputToContain('FAIL import_map_targets');
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue