diff --git a/.github/workflows/continuous-integration.yaml b/.github/workflows/continuous-integration.yaml index 7829b6f1f0..21e2279542 100644 --- a/.github/workflows/continuous-integration.yaml +++ b/.github/workflows/continuous-integration.yaml @@ -14,9 +14,9 @@ jobs: fail-fast: false matrix: operating-system: [ ubuntu-latest ] - php-version: [ '7.4', '8.0', '8.1' ] + php-version: [ '8.1', '8.2', '8.3' ] include: - - php-version: '8.1' + - php-version: '8.3' coverage: true steps: diff --git a/composer.json b/composer.json index 4a0609e467..c905a879d7 100644 --- a/composer.json +++ b/composer.json @@ -65,8 +65,8 @@ "oat-sa/lib-tao-qti": "^7.8.1", "oat-sa/oatbox-extension-installer": "~1.1||dev-master", "naneau/semver": "~0.0.7", - "oat-sa/generis": ">=15.39.0", - "oat-sa/tao-core": ">=54.25.0", + "oat-sa/generis": ">=16.0.0", + "oat-sa/tao-core": ">=54.26.0", "oat-sa/extension-tao-item": ">=12.4.0", "oat-sa/extension-tao-test": ">=16.3.0" }, diff --git a/model/Export/AbstractQTIItemExporter.php b/model/Export/AbstractQTIItemExporter.php index 6b13f70298..2ca5b1c072 100755 --- a/model/Export/AbstractQTIItemExporter.php +++ b/model/Export/AbstractQTIItemExporter.php @@ -24,6 +24,7 @@ namespace oat\taoQtiItem\model\Export; +use oat\oatbox\filesystem\FilesystemException; use oat\oatbox\reporting\Report; use oat\tao\helpers\Base64; use oat\tao\model\media\MediaBrowser; @@ -31,7 +32,6 @@ use oat\taoQtiItem\model\Export\Stylesheet\AssetStylesheetLoader; use core_kernel_classes_Property; use DOMDocument; -use League\Flysystem\FileNotFoundException; use oat\oatbox\filesystem\Directory; use oat\oatbox\service\ServiceManager; use oat\tao\model\media\ProcessedFileStreamAware; @@ -180,7 +180,7 @@ public function export($options = []) try { $xml = Service::singleton()->getXmlByRdfItem($this->getItem()); - } catch (FileNotFoundException $e) { + } catch (FilesystemException $e) { $report->setMessage($this->getExportErrorMessage(__('cannot find QTI XML'))); $report->setType(\common_report_Report::TYPE_ERROR); return $report; @@ -371,7 +371,7 @@ private function addAssetStylesheetToZip(string $link, string $baseDirectoryName foreach ($assetStylesheets as $stylesheetFile) { $this->addFile( $stylesheetFile['stream'], - $this->buildAssetStylesheetPath($basepath, $baseDirectoryName, $stylesheetFile['basename']) + $this->buildAssetStylesheetPath($basepath, $baseDirectoryName, basename($stylesheetFile['path'])) ); } } diff --git a/model/Export/ExportForm.php b/model/Export/ExportForm.php index 7e02c3e6ad..7eb22c1ebb 100755 --- a/model/Export/ExportForm.php +++ b/model/Export/ExportForm.php @@ -27,7 +27,7 @@ use common_exception_UserReadableException; use core_kernel_classes_Class; use core_kernel_classes_Resource; -use League\Flysystem\FileNotFoundException; +use oat\oatbox\filesystem\FilesystemException; use oat\tao\model\export\ExportElementException; use oat\taoQtiItem\model\ItemModel; use oat\taoQtiItem\model\qti\Service; @@ -202,7 +202,7 @@ protected function isInstanceValid($item) { try { $xml = Service::singleton()->getXmlByRdfItem($item); - } catch (FileNotFoundException $e) { + } catch (FilesystemException $e) { } if (empty($xml)) { diff --git a/model/Export/QtiPackageExportHandler.php b/model/Export/QtiPackageExportHandler.php index e84289c350..aba33d4bcd 100755 --- a/model/Export/QtiPackageExportHandler.php +++ b/model/Export/QtiPackageExportHandler.php @@ -28,8 +28,8 @@ use core_kernel_classes_Resource; use DomDocument; use Exception; -use League\Flysystem\FileNotFoundException; use oat\oatbox\event\EventManagerAwareTrait; +use oat\oatbox\filesystem\FilesystemException; use oat\oatbox\PhpSerializable; use oat\oatbox\PhpSerializeStateless; use oat\oatbox\service\ServiceManager; @@ -121,7 +121,7 @@ public function export($formValues, $destination) $manifest = $exporter->getManifest(); $report->add($subReport); - } catch (FileNotFoundException $e) { + } catch (FilesystemException $e) { $report->add(Report::createFailure(__('Item "%s" has no xml document', $item->getLabel()))); } catch (Exception $e) { $report->add( diff --git a/model/Export/Stylesheet/AssetStylesheetLoader.php b/model/Export/Stylesheet/AssetStylesheetLoader.php index 84a0078180..c9eeb1a33e 100644 --- a/model/Export/Stylesheet/AssetStylesheetLoader.php +++ b/model/Export/Stylesheet/AssetStylesheetLoader.php @@ -22,9 +22,10 @@ namespace oat\taoQtiItem\model\Export\Stylesheet; -use League\Flysystem\FileNotFoundException; -use League\Flysystem\FilesystemInterface; +use League\Flysystem\StorageAttributes; use oat\generis\model\OntologyAwareTrait; +use oat\oatbox\filesystem\FilesystemException; +use oat\oatbox\filesystem\FilesystemInterface; use oat\oatbox\filesystem\FileSystemService; use oat\oatbox\service\ConfigurableService; @@ -51,15 +52,18 @@ public function loadAssetsFromAssetResource(string $link): ?array $stylesheetPath = $this->buildAssetPathFromPropertyName($property); try { - $cssFiles = $this->getFileSystem()->listContents($stylesheetPath); + $cssFiles = $this->getFileSystem()->listContents($stylesheetPath)->toArray(); + $cssFilesInfo = []; + foreach ($cssFiles as $key => $file) { - $cssFiles[$key]['stream'] = $this->getFileSystem()->readStream( - $stylesheetPath . DIRECTORY_SEPARATOR . $file['basename'] + $cssFilesInfo[$key] = $file instanceof StorageAttributes ? $file->jsonSerialize() : $file; + $cssFilesInfo[$key]['stream'] = $this->getFileSystem()->readStream( + $stylesheetPath . DIRECTORY_SEPARATOR . basename($file['path']) ); } - return $cssFiles; - } catch (FileNotFoundException $exception) { + return $cssFilesInfo; + } catch (FilesystemException $exception) { $this->getLogger()->notice( sprintf( 'Stylesheet %s not found for resource %s', @@ -80,7 +84,7 @@ private function buildAssetPathFromPropertyName(string $property) DIRECTORY_SEPARATOR, [ dirname($property), - self::ASSET_CSS_DIRECTORY_NAME + self::ASSET_CSS_DIRECTORY_NAME, ] ); } diff --git a/model/Listener/ReplaceCopiedQtiXmlIdentifierListener.php b/model/Listener/ReplaceCopiedQtiXmlIdentifierListener.php index 21f2230257..7eb6765ab8 100644 --- a/model/Listener/ReplaceCopiedQtiXmlIdentifierListener.php +++ b/model/Listener/ReplaceCopiedQtiXmlIdentifierListener.php @@ -24,7 +24,6 @@ use common_Exception; use core_kernel_persistence_Exception; -use League\Flysystem\FileExistsException; use oat\oatbox\service\ServiceManager; use oat\taoItems\model\event\ItemContentClonedEvent; use oat\taoQtiItem\model\qti\copyist\QtiXmlDataManager; @@ -39,7 +38,6 @@ class ReplaceCopiedQtiXmlIdentifierListener { /** * @param ItemContentClonedEvent $itemContentClonedEvent - * @throws FileExistsException * @throws common_Exception * @throws core_kernel_persistence_Exception * @throws tao_models_classes_FileNotFoundException diff --git a/model/compile/QtiAssetCompiler/XIncludeAdditionalAssetInjector.php b/model/compile/QtiAssetCompiler/XIncludeAdditionalAssetInjector.php index ba20c54b16..37ca6fbc7a 100644 --- a/model/compile/QtiAssetCompiler/XIncludeAdditionalAssetInjector.php +++ b/model/compile/QtiAssetCompiler/XIncludeAdditionalAssetInjector.php @@ -25,7 +25,6 @@ use common_Exception; use oat\generis\Helper\UuidPrimaryKeyTrait; use oat\oatbox\service\ConfigurableService; -use League\Flysystem\FileExistsException; use oat\oatbox\filesystem\Directory; use oat\taoQtiItem\model\Export\Stylesheet\AssetStylesheetLoader; use oat\taoQtiItem\model\pack\QtiAssetPacker\PackedAsset; @@ -63,7 +62,7 @@ public function injectNonRDFXincludeRelatedAssets( if ($stylesheetFiles = $passageStylesheetLoader->loadAssetsFromAssetResource($passageResourceIdentifier)) { try { $this->includeSharedStimulusStylesheets($qtiItem, $publicDirectory, $stylesheetFiles, $xInclude); - } catch (QtiModelException | FileExistsException $e) { + } catch (QtiModelException $e) { $this->logWarning( sprintf( 'Compilation: Injecting stylesheet for Passage %s failed with message %s', @@ -77,7 +76,6 @@ public function injectNonRDFXincludeRelatedAssets( /** * @throws QtiModelException - * @throws FileExistsException * @throws common_Exception */ private function includeSharedStimulusStylesheets( @@ -98,7 +96,7 @@ private function includeSharedStimulusStylesheets( foreach ($stylesheetFiles as $stylesheetFile) { $targetPath = implode(DIRECTORY_SEPARATOR, [ $stylesheetTargetPubDirectory, - $stylesheetFile['basename'] + basename($stylesheetFile['path']) ]); $publicDirectory->getFile($targetPath)->write($stylesheetFile['stream']); @@ -106,7 +104,7 @@ private function includeSharedStimulusStylesheets( $qtiStylesheet = new Stylesheet( [ 'href' => $targetPath, - 'title' => $stylesheetFile['basename'], + 'title' => basename($stylesheetFile['path']), 'type' => 'text/css' ] ); diff --git a/model/flyExporter/extractor/QtiExtractor.php b/model/flyExporter/extractor/QtiExtractor.php index 6e539be7b9..3d72f73140 100644 --- a/model/flyExporter/extractor/QtiExtractor.php +++ b/model/flyExporter/extractor/QtiExtractor.php @@ -22,7 +22,7 @@ namespace oat\taoQtiItem\model\flyExporter\extractor; -use League\Flysystem\FileNotFoundException; +use oat\oatbox\filesystem\FilesystemException; use oat\taoQtiItem\model\qti\Service; /** @@ -106,7 +106,7 @@ private function loadXml(\core_kernel_classes_Resource $item) if (empty($xml)) { throw new ExtractorException('No content found for item ' . $item->getUri()); } - } catch (FileNotFoundException $e) { + } catch (FilesystemException $e) { throw new ExtractorException( 'qti.xml file was not found for item ' . $item->getUri() . '; The item might be empty.' ); diff --git a/model/portableElement/parser/itemParser/PortableElementItemParser.php b/model/portableElement/parser/itemParser/PortableElementItemParser.php index 48dbc04890..244da72f98 100644 --- a/model/portableElement/parser/itemParser/PortableElementItemParser.php +++ b/model/portableElement/parser/itemParser/PortableElementItemParser.php @@ -21,7 +21,6 @@ namespace oat\taoQtiItem\model\portableElement\parser\itemParser; -use League\Flysystem\FileNotFoundException; use oat\taoQtiItem\model\portableElement\exception\PortableElementInconsistencyModelException; use oat\taoQtiItem\model\portableElement\element\PortableElementObject; use oat\taoQtiItem\model\portableElement\model\PortableModelRegistry; @@ -276,7 +275,7 @@ protected function parsePortableElement(PortableElementModel $model, Element $po $configData['paths'][$id] = $this->getSourceAdjustedNodulePath($path); ; } else { - throw new FileNotFoundException( + throw new \tao_models_classes_FileNotFoundException( "The portable config {$configFile} references a missing module file " . "{$id} => {$path}" ); diff --git a/model/portableElement/storage/PortableElementFileStorage.php b/model/portableElement/storage/PortableElementFileStorage.php index 05043437a4..9d0fdac5eb 100644 --- a/model/portableElement/storage/PortableElementFileStorage.php +++ b/model/portableElement/storage/PortableElementFileStorage.php @@ -104,11 +104,8 @@ public function registerFiles(PortableElementObject $object, $files, $source) } $fileId = $this->getPrefix($object) . $object->getRegistrationFileId($file); - if ($fileSystem->has($fileId)) { - $registered = $fileSystem->updateStream($fileId, $resource); - } else { - $registered = $fileSystem->writeStream($fileId, $resource); - } + $fileSystem->writeStream($fileId, $resource); + $registered = true; if (is_resource($resource)) { fclose($resource); } @@ -127,16 +124,15 @@ public function registerFiles(PortableElementObject $object, $files, $source) */ public function unregisterFiles(PortableElementObject $object, $files) { - $deleted = true; $filesystem = $this->getFileStorage(); foreach ($files as $relPath) { $fileId = $this->getPrefix($object) . $relPath; - if (!$filesystem->has($fileId)) { + if (!$filesystem->fileExists($fileId)) { throw new \common_Exception('File does not exists in the filesystem: ' . $relPath); } - $deleted = $filesystem->delete($fileId); + $filesystem->delete($fileId); } - return $deleted; + return true; } /** @@ -146,13 +142,13 @@ public function unregisterFiles(PortableElementObject $object, $files) */ public function unregisterAllFiles(PortableElementObject $object) { - return $this->getFileStorage()->deleteDir($this->getPrefix($object)); + return $this->getFileStorage()->deleteDirectory($this->getPrefix($object)); } public function getFileContentFromModelStorage(PortableElementObject $object, $file) { $filePath = $this->getPrefix($object) . $file; - if ($this->getFileStorage()->has($filePath)) { + if ($this->getFileStorage()->fileExists($filePath)) { return $this->getFileStorage()->read($filePath); } throw new PortableElementFileStorageException('Unable to find file "' . $file . '"' . @@ -168,7 +164,7 @@ public function getFileContentFromModelStorage(PortableElementObject $object, $f public function getFileStream(PortableElementObject $object, $file) { $filePath = $this->getPrefix($object) . $file; - if ($this->getFileStorage()->has($filePath)) { + if ($this->getFileStorage()->fileExists($filePath)) { return new Stream($this->getFileStorage()->readStream($filePath)); } throw new PortableElementFileStorageException($filePath); diff --git a/model/portableElement/storage/PortableElementRegistry.php b/model/portableElement/storage/PortableElementRegistry.php index e665a8df5e..4cf56614fc 100644 --- a/model/portableElement/storage/PortableElementRegistry.php +++ b/model/portableElement/storage/PortableElementRegistry.php @@ -131,7 +131,7 @@ private function get($identifier) { $fileSystem = $this->getConfigFileSystem(); - if ($fileSystem->has($identifier)) { + if (!empty($identifier) && $fileSystem->fileExists($identifier)) { return json_decode($fileSystem->read($identifier), true); } @@ -145,7 +145,7 @@ private function getAll() foreach ($contents as $file) { if ($file['type'] === 'file') { - $identifier = $file['filename']; + $identifier = $file['path']; $elements[$identifier] = $this->get($identifier); } } @@ -161,7 +161,7 @@ private function getAll() */ private function set($identifier, $value) { - $this->getConfigFileSystem()->put($identifier, json_encode($value)); + $this->getConfigFileSystem()->write($identifier, json_encode($value)); } /** diff --git a/model/qti/Service.php b/model/qti/Service.php index 2438a565ae..ce4a54f96d 100755 --- a/model/qti/Service.php +++ b/model/qti/Service.php @@ -24,6 +24,7 @@ use common_exception_Error; use common_exception_NotFound; use oat\oatbox\filesystem\File; +use oat\oatbox\filesystem\FilesystemException; use oat\taoQtiItem\model\qti\parser\XmlToItemParser; use tao_helpers_Uri; use common_exception_FileSystemError; @@ -45,7 +46,6 @@ use common_Exception; use Exception; use oat\taoItems\model\media\ItemMediaResolver; -use League\Flysystem\FileNotFoundException; /** * The QTI_Service gives you a central access to the managment methods of the @@ -99,7 +99,7 @@ public function getDataItemByRdfItem(core_kernel_classes_Resource $item, $langCo if (!$returnValue->getAttributeValue('xml:lang')) { $returnValue->setAttribute('xml:lang', \common_session_SessionManager::getSession()->getDataLanguage()); } - } catch (FileNotFoundException $e) { + } catch (FilesystemException $e) { // fail silently, since file might not have been created yet // $returnValue is then NULL. common_Logger::d('item(' . $item->getUri() . ') is empty, newly created?'); diff --git a/scripts/fixItemGhostResponse.php b/scripts/fixItemGhostResponse.php index 00516ac227..cd49da8fab 100644 --- a/scripts/fixItemGhostResponse.php +++ b/scripts/fixItemGhostResponse.php @@ -30,7 +30,7 @@ // maybe it's a dirty way but it's quicker. too much modification would have been required in ItemUpdater $adapter = $dir->getFileSystem()->getAdapter(); -if (!$adapter instanceof \League\Flysystem\Adapter\Local) { +if (!$adapter instanceof \League\Flysystem\Local\LocalFilesystemAdapter) { throw new \Exception(__CLASS__ . ' can only handle local files'); } diff --git a/test/unit/model/Export/Stylesheet/AssetStylesheetLoaderTest.php b/test/unit/model/Export/Stylesheet/AssetStylesheetLoaderTest.php index 9bc6278a69..d6636f8206 100644 --- a/test/unit/model/Export/Stylesheet/AssetStylesheetLoaderTest.php +++ b/test/unit/model/Export/Stylesheet/AssetStylesheetLoaderTest.php @@ -24,10 +24,12 @@ use core_kernel_classes_Property; use core_kernel_classes_Resource; -use League\Flysystem\FilesystemInterface; +use League\Flysystem\DirectoryListing; +use League\Flysystem\FileAttributes; use oat\generis\model\data\Ontology; use oat\generis\test\TestCase; use oat\oatbox\filesystem\FileSystem; +use oat\oatbox\filesystem\FilesystemInterface; use oat\oatbox\filesystem\FileSystemService; use oat\taoMediaManager\model\fileManagement\FileManagement; use oat\taoMediaManager\model\fileManagement\FlySystemManagement; @@ -97,12 +99,11 @@ public function testLoadAssetsFromAssetResourceHappyPath(): void $fileInfo = [ 'type' => 'file', 'path' => 'dummy/path/file.css', - 'timestamp' => 1654502842, - 'size' => 0, - 'dirname' => 'dummy/path', - 'basename' => 'file.css', - 'extension' => 'css', - 'filename' => 'file', + 'last_modified' => 1654502842, + 'file_size' => 0, + 'mime_type' => 'css', + 'visibility' => 'public', + 'extra_metadata' => [], ]; $fileStream = "file stream resource"; @@ -110,7 +111,7 @@ public function testLoadAssetsFromAssetResourceHappyPath(): void $this->fileSystemMock ->expects($this->once()) ->method('listContents') - ->willReturn([$fileInfo]); + ->willReturn(new DirectoryListing([FileAttributes::fromArray($fileInfo)])); $this->fileSystemMock ->expects($this->once()) @@ -148,7 +149,7 @@ public function testLoadAssetsFromAssetResourceEmptyPath(): void $this->fileSystemMock ->expects($this->once()) ->method('listContents') - ->willReturn([]); + ->willReturn(new DirectoryListing([])); $result = $this->subject->loadAssetsFromAssetResource('encodedLinkToResource'); $this->assertEquals([], $result); diff --git a/test/unit/model/compile/XIncludeAdditionalAssetInjectorTest.php b/test/unit/model/compile/XIncludeAdditionalAssetInjectorTest.php index 3dacc20698..604deff235 100644 --- a/test/unit/model/compile/XIncludeAdditionalAssetInjectorTest.php +++ b/test/unit/model/compile/XIncludeAdditionalAssetInjectorTest.php @@ -23,7 +23,6 @@ namespace oat\taoQtiItem\test\unit\model\compile; -use League\Flysystem\FileExistsException; use oat\generis\test\TestCase; use oat\oatbox\filesystem\Directory; use oat\oatbox\filesystem\File; @@ -44,7 +43,7 @@ class XIncludeAdditionalAssetInjectorTest extends TestCase private const RESOURCE_ID_FIXTURE = 'fixture-id'; private const STYLESHEETS_LOADER_FILE = [ - 'basename' => 'file.css', + 'path' => 'file.css', 'stream' => 'dummy resource string' ]; @@ -114,9 +113,9 @@ public function testInjectNonRDFXincludeRelatedAssets() 'href' => implode(DIRECTORY_SEPARATOR, [ $this->subject::COMPILED_PASSAGE_STYLESHEET_FILENAME_PREFIX, AssetStylesheetLoader::ASSET_CSS_DIRECTORY_NAME, - self::STYLESHEETS_LOADER_FILE['basename'] + self::STYLESHEETS_LOADER_FILE['path'] ]), - 'title' => self::STYLESHEETS_LOADER_FILE['basename'], + 'title' => self::STYLESHEETS_LOADER_FILE['path'], 'type' => 'text/css' ], null, @@ -186,22 +185,6 @@ public function testInjectNonRDFXincludeRelatedAssetsWritesWarningLogOnQtiExcept $this->subject->injectNonRDFXincludeRelatedAssets($this->item, $this->directory, $packedAsset); } - public function testInjectNonRDFXincludeRelatedAssetsWritesWarningLogOnFileException() - { - $packedAsset = $this->getPackedAssetMock(); - $this->assetStylesheetLoader->method('loadAssetsFromAssetResource') - ->willReturn([self::STYLESHEETS_LOADER_FILE]); - - $this->fileMock->method('write') - ->willThrowException(new FileExistsException(self::DUMMY_EXCEPTION_MESSAGE)); - - $this->loggerMock->expects($this->atLeastOnce()) - ->method('warning') - ->with($this->stringContains(self::DUMMY_EXCEPTION_MESSAGE)); - - $this->subject->injectNonRDFXincludeRelatedAssets($this->item, $this->directory, $packedAsset); - } - public function testInjectNonRDFXincludeRelatedAssetsGeneratesCorrectWrapperClassPrefix() { $packedAsset = $this->getPackedAssetMock(); diff --git a/test/unit/model/qti/ItemTest.php b/test/unit/model/qti/ItemTest.php index d0609b5321..3a98a468d8 100644 --- a/test/unit/model/qti/ItemTest.php +++ b/test/unit/model/qti/ItemTest.php @@ -24,6 +24,8 @@ use common_ext_Extension; use common_ext_ExtensionsManager; +use League\Flysystem\FilesystemException; +use League\Flysystem\Local\LocalFilesystemAdapter; use oat\generis\test\ServiceManagerMockTrait; use oat\oatbox\filesystem\FileSystemService; use oat\oatbox\service\ServiceManager; @@ -31,7 +33,6 @@ use oat\taoQtiItem\model\qti\Item; use PHPUnit\Framework\TestCase; use League\Flysystem\Filesystem; -use League\Flysystem\Adapter\Local; class ItemTest extends TestCase { @@ -112,11 +113,11 @@ private function removeToolVersionAttribute(string $itemQti): string /** * @param string $name * @return string - * @throws \League\Flysystem\FileNotFoundException + * @throws FilesystemException */ private function readSampleFile(string $name): string { - $adapter = new Local( + $adapter = new LocalFilesystemAdapter( dirname(__DIR__, 2) . '/samples/model/qti/item' ); diff --git a/test/unit/model/qti/ParserFactoryTest.php b/test/unit/model/qti/ParserFactoryTest.php index cd79710780..cb8a49f4af 100644 --- a/test/unit/model/qti/ParserFactoryTest.php +++ b/test/unit/model/qti/ParserFactoryTest.php @@ -25,6 +25,8 @@ use common_ext_Extension; use common_ext_ExtensionsManager; use DOMDocument; +use League\Flysystem\FilesystemException; +use League\Flysystem\Local\LocalFilesystemAdapter; use oat\oatbox\service\ServiceManager; use oat\generis\test\ServiceManagerMockTrait; use oat\tao\model\service\ApplicationService; @@ -33,7 +35,6 @@ use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; use League\Flysystem\Filesystem; -use League\Flysystem\Adapter\Local; class ParserFactoryTest extends TestCase { @@ -133,11 +134,11 @@ public function testParseItemWithDirAttributeOnItemBody(): void /** * @param string $name * @return string - * @throws \League\Flysystem\FileNotFoundException + * @throws FilesystemException */ private function readSampleFile(string $name): string { - $adapter = new Local( + $adapter = new LocalFilesystemAdapter( dirname(__DIR__, 2) . '/samples/model/qti/parserFactory' ); diff --git a/test/unit/model/qti/copyist/QtiXmlDataManagerTest.php b/test/unit/model/qti/copyist/QtiXmlDataManagerTest.php index 113b4ff5ef..e988e2cfb2 100644 --- a/test/unit/model/qti/copyist/QtiXmlDataManagerTest.php +++ b/test/unit/model/qti/copyist/QtiXmlDataManagerTest.php @@ -27,7 +27,6 @@ use core_kernel_classes_Property; use core_kernel_classes_Resource; use core_kernel_persistence_Exception; -use League\Flysystem\FileExistsException; use oat\generis\model\data\Ontology; use oat\generis\model\fileReference\FileReferenceSerializer; use oat\generis\test\MockObject; @@ -162,7 +161,6 @@ private function getOntologyMock(): Ontology /** - * @throws FileExistsException * @throws common_Exception * @throws core_kernel_persistence_Exception * @throws tao_models_classes_FileNotFoundException @@ -173,7 +171,6 @@ public function testLocalNamespaceItemSource(): void } /** - * @throws FileExistsException * @throws common_Exception * @throws core_kernel_persistence_Exception * @throws tao_models_classes_FileNotFoundException @@ -184,7 +181,6 @@ public function testRemoteTaoNamespaceItemSource(): void } /** - * @throws FileExistsException * @throws common_Exception * @throws core_kernel_persistence_Exception * @throws tao_models_classes_FileNotFoundException