|
| setUp () |
| Sets up the fixture, for example, open a network connection. More...
|
|
◆ setUp()
ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccessTest::setUp |
( |
| ) |
|
|
protected |
Sets up the fixture, for example, open a network connection.
This method is called before a test is executed.
Definition at line 63 of file FlySystemFileAccessTestTBD.php.
67 $this->filesystemMock = Mockery::mock(FilesystemOperator::class);
68 $this->adapterMock = Mockery::mock(FilesystemAdapter::class);
69 $this->subject =
new FlySystemFileAccess($this->filesystemMock);
◆ testCopyWhichShouldSucceed()
ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccessTest::testCopyWhichShouldSucceed |
( |
| ) |
|
Definition at line 725 of file FlySystemFileAccessTestTBD.php.
727 $sourcePath =
'/path/to/your/source/file';
728 $destinationPath =
'/path/to/your/destination/file';
730 $this->filesystemMock
731 ->shouldReceive(
'has')
733 ->with($destinationPath)
736 ->shouldReceive(
'copy')
738 ->withArgs([$sourcePath, $destinationPath])
741 $this->subject->copy($sourcePath, $destinationPath);
◆ testCopyWithAdapterErrorWhichShouldFail()
ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccessTest::testCopyWithAdapterErrorWhichShouldFail |
( |
| ) |
|
Definition at line 746 of file FlySystemFileAccessTestTBD.php.
748 $sourcePath =
'/path/to/your/source/file';
749 $destinationPath =
'/path/to/your/destination/file';
751 $this->filesystemMock
752 ->shouldReceive(
'has')
754 ->with($destinationPath)
757 ->shouldReceive(
'copy')
759 ->withArgs([$sourcePath, $destinationPath])
760 ->andThrow(UnableToCopyFile::class);
762 $this->expectException(IOException::class);
763 $this->expectExceptionMessage(
764 "Could not copy file \"$sourcePath\" to destination \"$destinationPath\" because a general IO error occurred. Please check that your destination is writable." 767 $this->subject->copy($sourcePath, $destinationPath);
◆ testCopyWithExistingDestinationFileWhichShouldFail()
ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccessTest::testCopyWithExistingDestinationFileWhichShouldFail |
( |
| ) |
|
Definition at line 796 of file FlySystemFileAccessTestTBD.php.
798 $sourcePath =
'/path/to/your/source/file';
799 $destinationPath =
'/path/to/your/destination/file';
801 $this->filesystemMock
802 ->shouldReceive(
'has')
804 ->with($destinationPath)
807 ->shouldReceive(
'copy')
809 ->withArgs([$sourcePath, $destinationPath])
810 ->andThrow(UnableToCopyFile::class);
812 $this->expectException(FileAlreadyExistsException::class);
813 $this->expectExceptionMessage(
"File \"$destinationPath\" already exists.");
815 $this->subject->copy($sourcePath, $destinationPath);
◆ testCopyWithMissingFileWhichShouldFail()
ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccessTest::testCopyWithMissingFileWhichShouldFail |
( |
| ) |
|
Definition at line 772 of file FlySystemFileAccessTestTBD.php.
774 $sourcePath =
'/path/to/your/source/file';
775 $destinationPath =
'/path/to/your/destination/file';
777 $this->filesystemMock
778 ->shouldReceive(
'has')
780 ->with($destinationPath)
783 ->shouldReceive(
'copy')
785 ->withArgs([$sourcePath, $destinationPath])
786 ->andThrow(UnableToRetrieveMetadata::class);
788 $this->expectException(FileNotFoundException::class);
789 $this->expectExceptionMessage(
"File source \"$sourcePath\" was not found copy failed.");
791 $this->subject->copy($sourcePath, $destinationPath);
◆ testDeleteWhichShouldSucceed()
ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccessTest::testDeleteWhichShouldSucceed |
( |
| ) |
|
◆ testDeleteWithAdapterErrorWhichShouldFail()
ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccessTest::testDeleteWithAdapterErrorWhichShouldFail |
( |
| ) |
|
Definition at line 573 of file FlySystemFileAccessTestTBD.php.
References $path.
575 $path =
'/path/to/your/file';
577 $this->filesystemMock->shouldReceive(
'delete')
580 ->andThrow(UnableToDeleteFile::class);
582 $this->expectException(IOException::class);
583 $this->expectExceptionMessage(
584 "Could not delete file \"$path\" because a general IO error occurred. Please check that your target is writable." 587 $this->subject->delete(
$path);
◆ testDeleteWithMissingFileWhichShouldFail()
ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccessTest::testDeleteWithMissingFileWhichShouldFail |
( |
| ) |
|
Definition at line 592 of file FlySystemFileAccessTestTBD.php.
References $path.
594 $path =
'/path/to/your/file';
596 $this->filesystemMock->shouldReceive(
'delete')
599 ->andThrow(UnableToRetrieveMetadata::class);
601 $this->expectException(FileNotFoundException::class);
602 $this->expectExceptionMessage(
"File \"$path\" was not found delete operation failed.");
604 $this->subject->delete(
$path);
◆ testGetMimeTypeWhichShouldSucceed()
ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccessTest::testGetMimeTypeWhichShouldSucceed |
( |
| ) |
|
Definition at line 131 of file FlySystemFileAccessTestTBD.php.
133 $mimeType =
'image/jpeg';
134 $this->filesystemMock->shouldReceive(
'mimeType')
136 ->andReturn($mimeType);
138 $actualMimeType = $this->subject->getMimeType(
'/path/to/your/file');
139 $this->assertSame($mimeType, $actualMimeType);
◆ testGetMimeTypeWithMissingFileWhichShouldFail()
ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccessTest::testGetMimeTypeWithMissingFileWhichShouldFail |
( |
| ) |
|
Definition at line 186 of file FlySystemFileAccessTestTBD.php.
References $path.
188 $path =
'/path/to/your/file';
189 $this->filesystemMock->shouldReceive(
'mimeType')
192 ->andThrow(UnableToRetrieveMetadata::class);
194 $this->expectException(IOException::class);
195 $this->expectExceptionMessage(
"File \"$path\" not found.");
197 $this->subject->getMimeType(
$path);
◆ testGetMimeTypeWithUnknownMimeTypeWhichShouldFail()
ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccessTest::testGetMimeTypeWithUnknownMimeTypeWhichShouldFail |
( |
| ) |
|
Definition at line 172 of file FlySystemFileAccessTestTBD.php.
References $path.
174 $path =
'/path/to/your/file';
175 $this->filesystemMock->shouldReceive(
'mimeType')
180 $this->expectException(IOException::class);
181 $this->expectExceptionMessage(
"Could not determine the MIME type of the file \"$path\".");
183 $this->subject->getMimeType(
$path);
◆ testGetSizeWhichShouldSucceed()
ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccessTest::testGetSizeWhichShouldSucceed |
( |
| ) |
|
◆ testGetSizeWithMissingFileWhichShouldFail()
ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccessTest::testGetSizeWithMissingFileWhichShouldFail |
( |
| ) |
|
Definition at line 283 of file FlySystemFileAccessTestTBD.php.
References $path, and ILIAS\Data\DataSize\GiB.
285 $path =
'/path/to/your/file';
286 $this->filesystemMock
287 ->shouldReceive(
'fileSize')
290 ->andThrow(UnableToRetrieveMetadata::class);
292 $this->expectException(IOException::class);
293 $this->expectExceptionMessage(
"File \"$path\" not found.");
◆ testGetSizeWithUnknownAdapterErrorWhichShouldFail()
ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccessTest::testGetSizeWithUnknownAdapterErrorWhichShouldFail |
( |
| ) |
|
Definition at line 268 of file FlySystemFileAccessTestTBD.php.
References $path, and ILIAS\Data\DataSize\MiB.
270 $path =
'/path/to/your/file';
271 $this->filesystemMock
272 ->shouldReceive(
'fileSize')
275 ->andThrow(UnableToRetrieveMetadata::class);
277 $this->expectException(IOException::class);
278 $this->expectExceptionMessage(
"File \"$path\" not found.");
◆ testGetTimestampWhichShouldSucceed()
ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccessTest::testGetTimestampWhichShouldSucceed |
( |
| ) |
|
Definition at line 200 of file FlySystemFileAccessTestTBD.php.
References $datetime, and $timestamp.
204 $this->filesystemMock
205 ->shouldReceive(
'lastModified')
209 $actualTimestamp = $this->subject->getTimestamp(
'/path/to/your/file');
foreach($mandatory_scripts as $file) $timestamp
◆ testGetTimestampWithMissingFileWhichShouldFail()
ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccessTest::testGetTimestampWithMissingFileWhichShouldFail |
( |
| ) |
|
Definition at line 240 of file FlySystemFileAccessTestTBD.php.
References $path.
242 $path =
'/path/to/your/file';
243 $this->filesystemMock
244 ->shouldReceive(
'lastModified')
247 ->andThrow(UnableToReadFile::class);
249 $this->expectException(IOException::class);
250 $this->expectExceptionMessage(
"File \"$path\" not found.");
252 $this->subject->getTimestamp(
$path);
◆ testGetTimestampWithUnknownErrorWhichShouldFail()
ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccessTest::testGetTimestampWithUnknownErrorWhichShouldFail |
( |
| ) |
|
Definition at line 225 of file FlySystemFileAccessTestTBD.php.
References $path.
227 $path =
'/path/to/your/file';
228 $this->filesystemMock
229 ->shouldReceive(
'lastModified')
232 ->andThrow(UnableToRetrieveMetadata::class);
234 $this->expectException(IOException::class);
235 $this->expectExceptionMessage(
"Could not lookup timestamp of the file \"$path\".");
237 $this->subject->getTimestamp(
$path);
◆ testGetVisibilityWhichShouldSucceed()
ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccessTest::testGetVisibilityWhichShouldSucceed |
( |
| ) |
|
Definition at line 374 of file FlySystemFileAccessTestTBD.php.
References $path.
376 $path =
'/path/to/your/file';
377 $visibility =
"private";
379 $this->filesystemMock->shouldReceive(
'has')
384 $this->filesystemMock->shouldReceive(
'getVisibility')
387 ->andReturn($visibility);
389 $actualVisibility = $this->subject->getVisibility(
$path);
390 $this->assertSame($visibility, $actualVisibility);
◆ testGetVisibilityWithAdapterErrorWhichShouldFail()
ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccessTest::testGetVisibilityWithAdapterErrorWhichShouldFail |
( |
| ) |
|
Definition at line 412 of file FlySystemFileAccessTestTBD.php.
References $path.
414 $path =
'/path/to/your/file';
416 $this->filesystemMock->shouldReceive(
'has')
421 $this->filesystemMock->shouldReceive(
'getVisibility')
426 $this->expectException(IOException::class);
427 $this->expectExceptionMessage(
"Could not determine visibility for path '$path'.");
429 $this->subject->getVisibility(
$path);
◆ testGetVisibilityWithMissingFileWhichShouldFail()
ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccessTest::testGetVisibilityWithMissingFileWhichShouldFail |
( |
| ) |
|
Definition at line 395 of file FlySystemFileAccessTestTBD.php.
References $path.
397 $path =
'/path/to/your/file';
399 $this->filesystemMock->shouldReceive(
'has')
404 $this->expectException(FileNotFoundException::class);
405 $this->expectExceptionMessage(
"Path \"$path\" not found.");
407 $this->subject->getVisibility(
$path);
◆ testPutContentExistingFile()
ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccessTest::testPutContentExistingFile |
( |
| ) |
|
Definition at line 142 of file FlySystemFileAccessTestTBD.php.
144 $content =
'Test file content.';
145 $this->filesystemMock->shouldReceive(
'has')
148 $this->filesystemMock->shouldReceive(
'write')
149 ->with(
'/path/to/your/file', $content)
153 $this->subject->put(
'/path/to/your/file', $content);
◆ testPutContentNonExistingFile()
ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccessTest::testPutContentNonExistingFile |
( |
| ) |
|
Definition at line 156 of file FlySystemFileAccessTestTBD.php.
158 $content =
'Test file content.';
159 $this->filesystemMock->shouldReceive(
'has')
163 $this->filesystemMock->shouldReceive(
'write')
164 ->with(
'/path/to/your/file', $content)
168 $this->subject->put(
'/path/to/your/file', $content);
◆ testReadAndDeleteWhichShouldSucceed()
ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccessTest::testReadAndDeleteWhichShouldSucceed |
( |
| ) |
|
Definition at line 609 of file FlySystemFileAccessTestTBD.php.
References $path.
611 $path =
'/path/to/your/file';
612 $content =
"awesome content";
615 $this->subject = Mockery::mock(FlySystemFileAccess::class, [$this->filesystemMock])->makePartial();
618 ->shouldReceive(
'read')
621 ->andReturn($content)
623 ->shouldReceive(
'delete')
627 $this->subject->readAndDelete(
$path);
◆ testReadWhichShouldSucceed()
ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccessTest::testReadWhichShouldSucceed |
( |
| ) |
|
Definition at line 72 of file FlySystemFileAccessTestTBD.php.
References $path.
74 $file_content =
'Test file content.';
75 $path =
'/path/to/your/file';
77 $this->filesystemMock->shouldReceive(
'has')
79 ->with(ltrim(
$path,
'/'))
82 $this->filesystemMock->shouldReceive(
'read')
83 ->with(ltrim(
$path,
'/'))
85 ->andReturn($file_content);
88 $actualContent = $this->subject->read(
$path);
89 $this->assertSame($file_content, $actualContent);
◆ testReadWithGeneralFileAccessErrorWhichShouldFail()
ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccessTest::testReadWithGeneralFileAccessErrorWhichShouldFail |
( |
| ) |
|
Definition at line 92 of file FlySystemFileAccessTestTBD.php.
References $path.
94 $path =
'/path/to/your/file';
96 $this->filesystemMock->shouldReceive(
'has')
98 ->with(ltrim(
$path,
'/'))
101 $this->filesystemMock->shouldReceive(
'read')
102 ->with(ltrim(
$path,
'/'))
107 $this->expectException(IOException::class);
108 $this->expectExceptionMessage(
'File "' . ltrim(
$path,
'/') .
'" not found.');
109 $actualContent = $this->subject->read(
$path);
◆ testReadWithMissingFileWhichShouldFail()
ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccessTest::testReadWithMissingFileWhichShouldFail |
( |
| ) |
|
Definition at line 112 of file FlySystemFileAccessTestTBD.php.
References $path.
115 $path =
'/path/to/your/file';
117 $this->filesystemMock->shouldReceive(
'has')
119 ->with(ltrim(
$path,
'/'))
122 $this->filesystemMock->shouldReceive(
'read')
126 $this->expectException(IOException::class);
127 $this->expectExceptionMessage(
'File "' . ltrim(
$path,
'/') .
'" not found.');
128 $actualContent = $this->subject->read(
$path);
◆ testRenameWhichShouldSucceed()
ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccessTest::testRenameWhichShouldSucceed |
( |
| ) |
|
Definition at line 632 of file FlySystemFileAccessTestTBD.php.
634 $source =
'/source/path';
635 $destination =
'/dest/path';
637 $this->filesystemMock
638 ->shouldReceive(
'has')
643 ->shouldReceive(
'move')
645 ->withArgs([$source, $destination])
648 $this->subject->rename($source, $destination);
◆ testRenameWithExistingDestinationWhichShouldFail()
ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccessTest::testRenameWithExistingDestinationWhichShouldFail |
( |
| ) |
|
Definition at line 677 of file FlySystemFileAccessTestTBD.php.
679 $source =
'/source/path';
680 $destination =
'/dest/path';
682 $this->filesystemMock
683 ->shouldReceive(
'has')
688 ->shouldReceive(
'move')
690 ->withArgs([$source, $destination])
691 ->andThrow(UnableToMoveFile::class);
693 $this->expectException(IOException::class);
694 $this->expectExceptionMessage(
"File \"$destination\" already exists.");
696 $this->subject->rename($source, $destination);
◆ testRenameWithGeneralErrorWhichShouldFail()
ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccessTest::testRenameWithGeneralErrorWhichShouldFail |
( |
| ) |
|
Definition at line 701 of file FlySystemFileAccessTestTBD.php.
703 $source =
'/source/path';
704 $destination =
'/dest/path';
706 $this->filesystemMock
707 ->shouldReceive(
'has')
712 ->shouldReceive(
'move')
714 ->withArgs([$source, $destination])
715 ->andThrow(UnableToMoveFile::class);
717 $this->expectException(IOException::class);
718 $this->expectExceptionMessage(
"Could not move file from \"$source\" to \"$destination\".");
720 $this->subject->rename($source, $destination);
◆ testRenameWithMissingSourceWhichShouldFail()
ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccessTest::testRenameWithMissingSourceWhichShouldFail |
( |
| ) |
|
Definition at line 653 of file FlySystemFileAccessTestTBD.php.
655 $source =
'/source/path';
656 $destination =
'/dest/path';
658 $this->filesystemMock
659 ->shouldReceive(
'has')
664 ->shouldReceive(
'move')
666 ->withArgs([$source, $destination])
667 ->andThrow(UnableToRetrieveMetadata::class);
669 $this->expectException(FileNotFoundException::class);
670 $this->expectExceptionMessage(
"File \"$source\" not found.");
672 $this->subject->rename($source, $destination);
◆ testSetVisibilityThatFailedDueToAdapterFailureWhichShouldFail()
ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccessTest::testSetVisibilityThatFailedDueToAdapterFailureWhichShouldFail |
( |
| ) |
|
Definition at line 317 of file FlySystemFileAccessTestTBD.php.
References $path.
319 $path =
'/path/to/your/file';
320 $visibility =
"private";
322 $this->filesystemMock->shouldReceive(
'has')
327 $this->filesystemMock->shouldReceive(
'setVisibility')
329 ->withArgs([
$path, $visibility])
330 ->andThrow(UnableToSetVisibility::class);
332 $operationSuccessful = $this->subject->setVisibility(
$path, $visibility);
333 $this->assertFalse($operationSuccessful);
◆ testSetVisibilityWhichShouldSucceed()
ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccessTest::testSetVisibilityWhichShouldSucceed |
( |
| ) |
|
Definition at line 298 of file FlySystemFileAccessTestTBD.php.
References $path.
300 $path =
'/path/to/your/file';
301 $visibility =
"private";
303 $this->filesystemMock->shouldReceive(
'has')
308 $this->filesystemMock->shouldReceive(
'setVisibility')
310 ->withArgs([
$path, $visibility])
313 $operationSuccessful = $this->subject->setVisibility(
$path, $visibility);
314 $this->assertTrue($operationSuccessful);
◆ testSetVisibilityWithInvalidAccessModifierWhichShouldFail()
ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccessTest::testSetVisibilityWithInvalidAccessModifierWhichShouldFail |
( |
| ) |
|
Definition at line 356 of file FlySystemFileAccessTestTBD.php.
References $path.
358 $path =
'/path/to/your/file';
359 $visibility =
"not valid";
361 $this->filesystemMock->shouldReceive(
'has')
366 $this->expectException(\InvalidArgumentException::class);
367 $this->expectExceptionMessage(
"The access must be 'public' or 'private' but '$visibility' was given.");
369 $this->subject->setVisibility(
$path, $visibility);
◆ testSetVisibilityWithMissingFileWhichShouldFail()
ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccessTest::testSetVisibilityWithMissingFileWhichShouldFail |
( |
| ) |
|
Definition at line 338 of file FlySystemFileAccessTestTBD.php.
References $path.
340 $path =
'/path/to/your/file';
341 $visibility =
"private";
343 $this->filesystemMock->shouldReceive(
'has')
348 $this->expectException(FileNotFoundException::class);
349 $this->expectExceptionMessage(
"Path \"$path\" not found.");
351 $this->subject->setVisibility(
$path, $visibility);
◆ testUpdateWhichShouldSucceed()
ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccessTest::testUpdateWhichShouldSucceed |
( |
| ) |
|
Definition at line 503 of file FlySystemFileAccessTestTBD.php.
References $path.
505 $path =
'/path/to/your/file';
506 $content =
"some awesome content";
508 $this->filesystemMock->shouldReceive(
'write')
510 ->withArgs([
$path, $content])
513 $this->subject->update(
$path, $content);
◆ testUpdateWithAdapterErrorWhichShouldFail()
ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccessTest::testUpdateWithAdapterErrorWhichShouldFail |
( |
| ) |
|
Definition at line 518 of file FlySystemFileAccessTestTBD.php.
References $path.
520 $path =
'/path/to/your/file';
521 $content =
"some awesome content";
523 $this->filesystemMock->shouldReceive(
'write')
525 ->withArgs([
$path, $content])
526 ->andThrow(UnableToWriteFile::class);
528 $this->expectException(IOException::class);
529 $this->expectExceptionMessage(
530 "Could not write to file \"$path\" because a general IO error occurred. Please check that your destination is writable." 533 $this->subject->update(
$path, $content);
◆ testUpdateWithMissingFileWhichShouldFail()
ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccessTest::testUpdateWithMissingFileWhichShouldFail |
( |
| ) |
|
Definition at line 538 of file FlySystemFileAccessTestTBD.php.
References $path.
540 $path =
'/path/to/your/file';
541 $content =
"some awesome content";
543 $this->filesystemMock
544 ->shouldReceive(
'write')
546 ->withArgs([
$path, $content])
547 ->andThrow(UnableToWriteFile::class);
549 $this->expectException(IOException::class);
550 $this->expectExceptionMessage(
551 "Could not write to file \"$path\" because a general IO error occurred. Please check that your destination is writable." 554 $this->subject->update(
$path, $content);
◆ testWriteWhichShouldSucceed()
ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccessTest::testWriteWhichShouldSucceed |
( |
| ) |
|
Definition at line 434 of file FlySystemFileAccessTestTBD.php.
References $path.
436 $path =
'/path/to/your/file';
437 $content =
"some awesome content";
439 $this->filesystemMock
440 ->shouldReceive(
'has')
445 ->shouldReceive(
'write')
447 ->withArgs([
$path, $content]);
449 $this->subject->write(
$path, $content);
◆ testWriteWithAdapterErrorWhichShouldFail()
ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccessTest::testWriteWithAdapterErrorWhichShouldFail |
( |
| ) |
|
Definition at line 477 of file FlySystemFileAccessTestTBD.php.
References $path.
479 $path =
'/path/to/your/file';
480 $content =
"some awesome content";
482 $this->filesystemMock
483 ->shouldReceive(
'has')
488 ->shouldReceive(
'write')
490 ->withArgs([
$path, $content])
491 ->andThrow(UnableToWriteFile::class);
493 $this->expectException(IOException::class);
494 $this->expectExceptionMessage(
495 "Could not write to file \"$path\" because a general IO error occurred. Please check that your destination is writable." 498 $this->subject->write(
$path, $content);
◆ testWriteWithAlreadyExistingFileWhichShouldFail()
ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccessTest::testWriteWithAlreadyExistingFileWhichShouldFail |
( |
| ) |
|
Definition at line 454 of file FlySystemFileAccessTestTBD.php.
References $path.
456 $path =
'/path/to/your/file';
457 $content =
"some awesome content";
459 $this->filesystemMock
460 ->shouldReceive(
'has')
464 ->shouldReceive(
'write')
466 ->withArgs([
$path, $content])
467 ->andThrow(UnableToWriteFile::class);
469 $this->expectException(FileAlreadyExistsException::class);
470 $this->expectExceptionMessage(
"File \"$path\" already exists.");
472 $this->subject->write(
$path, $content);
◆ $adapterMock
LegacyMockInterface ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccessTest::$adapterMock |
|
private |
◆ $filesystemMock
Filesystem MockInterface ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccessTest::$filesystemMock |
|
private |
◆ $subject
The documentation for this class was generated from the following file: