21 lines
783 B
PHP
21 lines
783 B
PHP
<?php
|
|
|
|
namespace Tests\Unit;
|
|
|
|
use App\Services\EconomicReferenceCatalog;
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
class EconomicReferenceManifestTest extends TestCase
|
|
{
|
|
public function test_the_distributed_manifest_matches_the_existing_approved_byte_hash(): void
|
|
{
|
|
$path = dirname(__DIR__, 2).'/database/data/economic-references-lot-01.json';
|
|
$this->assertSame(EconomicReferenceCatalog::MANIFEST_SHA256, hash_file('sha256', $path));
|
|
$manifest = json_decode(file_get_contents($path), true, 512, JSON_THROW_ON_ERROR);
|
|
$this->assertSame(EconomicReferenceCatalog::LOT, $manifest['lot']);
|
|
$this->assertCount(5, $manifest['activities']);
|
|
$this->assertCount(5, $manifest['chains']);
|
|
$this->assertCount(4, $manifest['links']);
|
|
}
|
|
}
|