getExtensionById('taoQtiItem'); } /** * @throws common_Exception * @throws common_exception_Error */ public function testFileParsingQtiPic(): void { $extensionManager = common_ext_ExtensionsManager::singleton(); if (!$extensionManager->isInstalled('qtiItemPic') || !$extensionManager->isEnabled('qtiItemPic')) { self::markTestSkipped('The extension qtiItemPic should be installed to run this test.'); } $files = glob(__DIR__ . '/samples/xml/qtiv2p1/pic/*.xml'); //check if samples are loaded foreach ($files as $file) { $qtiParser = new Parser($file); $qtiParser->validate(); if (!$qtiParser->isValid()) { echo $qtiParser->displayErrors(); } $item = $qtiParser->load(); self::assertInstanceOf(Item::class, $item); } } }