fix: complete InvesteMoz validation and error corrections
This commit is contained in:
@@ -34,6 +34,17 @@ class LegacyEditorialWorkflowTest extends TestCase
|
||||
$identities = json_decode(file_get_contents(config_path('legacy_editorial_resources.json')), true);
|
||||
$this->resources = DB::table('portal_resources as r')->join('documents as d', 'd.id', '=', 'r.document_id')->whereIn('d.external_id', array_column($identities, 'external_id'))->orderBy('r.id')->get(['r.*']);
|
||||
$this->assertCount(28, $this->resources);
|
||||
$originalsRoot = getenv('INVESTMOZ_QA_ORIGINALS_ROOT');
|
||||
if (is_string($originalsRoot) && $originalsRoot !== '') {
|
||||
Storage::fake('local');
|
||||
foreach (DB::table('documents')->whereIn('id', $this->resources->pluck('document_id'))->get() as $document) {
|
||||
$source = $originalsRoot.'/'.$document->storage_key;
|
||||
$this->assertFileExists($source);
|
||||
$this->assertSame(trim($document->sha256), hash_file('sha256', $source));
|
||||
Storage::disk('local')->put($document->storage_key, file_get_contents($source));
|
||||
}
|
||||
}
|
||||
|
||||
$this->editor = User::factory()->create();
|
||||
config(['portal.managers' => [$this->editor->email]]);
|
||||
$this->actingAs($this->editor);
|
||||
|
||||
Reference in New Issue
Block a user