db = new Database(new Config()); try { $this->db->fetch('SELECT 1'); } catch (Throwable $exception) { self::markTestSkipped('Base injoignable: ' . $exception->getMessage()); } } public function testListsIncoReferenceWithCodeNameAndDescription(): void { $rows = (new AllergenRepository($this->db))->all(); self::assertGreaterThanOrEqual(14, count($rows), 'les 14 allergenes INCO doivent etre references'); foreach ($rows as $a) { self::assertArrayHasKey('code', $a); self::assertArrayHasKey('name', $a); self::assertArrayHasKey('description', $a); self::assertNotSame('', (string) ($a['name'] ?? '')); } // La description INCO est seede (migration 0001 + seed 0001) : au moins une non vide. $descriptions = array_filter($rows, static fn (array $a): bool => (string) ($a['description'] ?? '') !== ''); self::assertNotEmpty($descriptions, 'la description INCO doit etre exposee'); } }