_lists[] = pathinfo($file, PATHINFO_FILENAME); } } } /** * Test all concordance lists for their implementation of MDImporterConcordanceListInterface. * * @return void */ public function testListInterfaceIsImplemented():void { foreach ($this->_lists as $list) { if (!file_exists(__DIR__ . '/../src/' . $list . '.php')) { throw new Exception("List file does not exist" . $list); } require_once __DIR__ . '/../src/' . $list . '.php'; $interfaces = class_implements(new $list); self::assertArrayHasKey('MDImporterConcordanceListInterface', $interfaces); } } /** * Ensure all tests throw the MDImporterMissingConcordance exception, if * a new value is encountered. * * @return void */ public function testMDImporterMissingConcordanceIsThrownForNewValues():void { foreach ($this->_lists as $list) { $this->expectException(MDImporterMissingConcordance::class); (new $list)::getConcordanceTarget("ThisInputShouldNotExist"); } } }