Class FlySystemFileStreamAccessTest.
More...
|
| setUp () |
| Sets up the fixture, for example, open a network connection. More...
|
|
◆ setUp()
Filesystem\Provider\FlySystem\FlySystemFileStreamAccessTest::setUp |
( |
| ) |
|
|
protected |
Sets up the fixture, for example, open a network connection.
This method is called before a test is executed.
Definition at line 56 of file FlySystemFileStreamAccessTest.php.
60 $this->filesystemMock = \Mockery::mock(FilesystemInterface::class);
61 $this->subject =
new FlySystemFileStreamAccess($this->filesystemMock);
◆ testPutStreamWhichShouldSucceed()
Filesystem\Provider\FlySystem\FlySystemFileStreamAccessTest::testPutStreamWhichShouldSucceed |
( |
| ) |
|
◆ testPutStreamWithDetachedStreamWhichShouldFail()
Filesystem\Provider\FlySystem\FlySystemFileStreamAccessTest::testPutStreamWithDetachedStreamWhichShouldFail |
( |
| ) |
|
Definition at line 242 of file FlySystemFileStreamAccessTest.php.
References $path, and ILIAS\Filesystem\Stream\Streams\ofString().
244 $path =
'/path/to/your/file';
245 $fileContent =
'Awesome file content';
249 $this->expectException(\InvalidArgumentException::class);
250 $this->expectExceptionMessage(
'The given stream must not be detached.');
252 $this->subject->putStream(
$path, $stream);
static ofString(string $string)
Creates a new stream with an initial value.
◆ testPutStreamWithGeneralFailureWhichShouldFail()
Filesystem\Provider\FlySystem\FlySystemFileStreamAccessTest::testPutStreamWithGeneralFailureWhichShouldFail |
( |
| ) |
|
Definition at line 221 of file FlySystemFileStreamAccessTest.php.
References $path, and ILIAS\Filesystem\Stream\Streams\ofString().
223 $path =
'/path/to/your/file';
224 $fileContent =
'Awesome file content';
227 $this->filesystemMock->shouldReceive(
'putStream')
229 ->withArgs([
$path, \resourceValue()])
232 $this->expectException(IOException::class);
233 $this->expectExceptionMessage(
"Could not put stream content into \"$path\"");
235 $this->subject->putStream(
$path, $stream);
static ofString(string $string)
Creates a new stream with an initial value.
◆ testReadStreamWhichShouldSucceed()
Filesystem\Provider\FlySystem\FlySystemFileStreamAccessTest::testReadStreamWhichShouldSucceed |
( |
| ) |
|
Definition at line 68 of file FlySystemFileStreamAccessTest.php.
References $path.
70 $path =
'/path/to/your/file';
71 $fileContent =
'Awesome file content';
72 $stream = fopen(
'data://text/plain,' . $fileContent, $fileContent,
'r');
74 $this->filesystemMock->shouldReceive(
'readStream')
79 $wrappedStream = $this->subject->readStream(
$path);
81 $this->assertSame($fileContent, $wrappedStream->getContents());
◆ testReadStreamWithGeneralFailureWhichShouldFail()
Filesystem\Provider\FlySystem\FlySystemFileStreamAccessTest::testReadStreamWithGeneralFailureWhichShouldFail |
( |
| ) |
|
Definition at line 107 of file FlySystemFileStreamAccessTest.php.
References $path.
109 $path =
'/path/to/your/file';
111 $this->filesystemMock->shouldReceive(
'readStream')
116 $this->expectException(IOException::class);
117 $this->expectExceptionMessage(
"Could not open stream for file \"$path\"");
119 $this->subject->readStream(
$path);
◆ testReadStreamWithMissingFileWhichShouldFail()
Filesystem\Provider\FlySystem\FlySystemFileStreamAccessTest::testReadStreamWithMissingFileWhichShouldFail |
( |
| ) |
|
Definition at line 88 of file FlySystemFileStreamAccessTest.php.
References $path.
90 $path =
'/path/to/your/file';
92 $this->filesystemMock->shouldReceive(
'readStream')
95 ->andThrow(FileNotFoundException::class);
98 $this->expectExceptionMessage(
"File \"$path\" not found.");
100 $this->subject->readStream(
$path);
Class ChatMainBarProvider .
Class FlySystemFileAccessTest disabled disabled disabled.
◆ testUpdateStreamWhichShouldSucceed()
Filesystem\Provider\FlySystem\FlySystemFileStreamAccessTest::testUpdateStreamWhichShouldSucceed |
( |
| ) |
|
◆ testUpdateStreamWithDetachedStreamWhichShouldFail()
Filesystem\Provider\FlySystem\FlySystemFileStreamAccessTest::testUpdateStreamWithDetachedStreamWhichShouldFail |
( |
| ) |
|
Definition at line 277 of file FlySystemFileStreamAccessTest.php.
References $path, and ILIAS\Filesystem\Stream\Streams\ofString().
279 $path =
'/path/to/your/file';
280 $fileContent =
'Awesome file content';
284 $this->expectException(\InvalidArgumentException::class);
285 $this->expectExceptionMessage(
'The given stream must not be detached.');
287 $this->subject->updateStream(
$path, $stream);
static ofString(string $string)
Creates a new stream with an initial value.
◆ testUpdateStreamWithGeneralFailureWhichShouldFail()
Filesystem\Provider\FlySystem\FlySystemFileStreamAccessTest::testUpdateStreamWithGeneralFailureWhichShouldFail |
( |
| ) |
|
Definition at line 294 of file FlySystemFileStreamAccessTest.php.
References $path, and ILIAS\Filesystem\Stream\Streams\ofString().
296 $path =
'/path/to/your/file';
297 $fileContent =
'Awesome file content';
300 $this->filesystemMock->shouldReceive(
'updateStream')
302 ->withArgs([
$path, \resourceValue()])
305 $this->expectException(IOException::class);
306 $this->expectExceptionMessage(
"Could not update file \"$path\"");
308 $this->subject->updateStream(
$path, $stream);
static ofString(string $string)
Creates a new stream with an initial value.
◆ testUpdateStreamWithMissingFileWhichShouldFail()
Filesystem\Provider\FlySystem\FlySystemFileStreamAccessTest::testUpdateStreamWithMissingFileWhichShouldFail |
( |
| ) |
|
Definition at line 315 of file FlySystemFileStreamAccessTest.php.
References $path, and ILIAS\Filesystem\Stream\Streams\ofString().
317 $path =
'/path/to/your/file';
318 $fileContent =
'Awesome file content';
321 $this->filesystemMock->shouldReceive(
'updateStream')
323 ->withArgs([
$path, \resourceValue()])
324 ->andThrow(FileNotFoundException::class);
327 $this->expectExceptionMessage(
"File \"$path\" not found.");
329 $this->subject->updateStream(
$path, $stream);
Class ChatMainBarProvider .
static ofString(string $string)
Creates a new stream with an initial value.
Class FlySystemFileAccessTest disabled disabled disabled.
◆ testWriteStreamWhichShouldSucceed()
Filesystem\Provider\FlySystem\FlySystemFileStreamAccessTest::testWriteStreamWhichShouldSucceed |
( |
| ) |
|
◆ testWriteStreamWithDetachedStreamWhichShouldFail()
Filesystem\Provider\FlySystem\FlySystemFileStreamAccessTest::testWriteStreamWithDetachedStreamWhichShouldFail |
( |
| ) |
|
Definition at line 144 of file FlySystemFileStreamAccessTest.php.
References $path, and ILIAS\Filesystem\Stream\Streams\ofString().
146 $path =
'/path/to/your/file';
147 $fileContent =
'Awesome file content';
151 $this->expectException(\InvalidArgumentException::class);
152 $this->expectExceptionMessage(
'The given stream must not be detached.');
154 $this->subject->writeStream(
$path, $stream);
static ofString(string $string)
Creates a new stream with an initial value.
◆ testWriteStreamWithExistingFileWhichShouldFail()
Filesystem\Provider\FlySystem\FlySystemFileStreamAccessTest::testWriteStreamWithExistingFileWhichShouldFail |
( |
| ) |
|
Definition at line 161 of file FlySystemFileStreamAccessTest.php.
References $path, and ILIAS\Filesystem\Stream\Streams\ofString().
163 $path =
'/path/to/your/file';
164 $fileContent =
'Awesome file content';
167 $this->filesystemMock->shouldReceive(
'writeStream')
169 ->withArgs([
$path, \resourceValue()])
170 ->andThrow(FileExistsException::class);
172 $this->expectException(FileAlreadyExistsException::class);
173 $this->expectExceptionMessage(
"File \"$path\" already exists.");
175 $this->subject->writeStream(
$path, $stream);
static ofString(string $string)
Creates a new stream with an initial value.
◆ testWriteStreamWithFailingAdapterWhichShouldFail()
Filesystem\Provider\FlySystem\FlySystemFileStreamAccessTest::testWriteStreamWithFailingAdapterWhichShouldFail |
( |
| ) |
|
Definition at line 182 of file FlySystemFileStreamAccessTest.php.
References $path, and ILIAS\Filesystem\Stream\Streams\ofString().
184 $path =
'/path/to/your/file';
185 $fileContent =
'Awesome file content';
188 $this->filesystemMock->shouldReceive(
'writeStream')
190 ->withArgs([
$path, \resourceValue()])
193 $this->expectException(IOException::class);
194 $this->expectExceptionMessage(
"Could not write stream to file \"$path\"");
196 $this->subject->writeStream(
$path, $stream);
static ofString(string $string)
Creates a new stream with an initial value.
◆ $filesystemMock
Filesystem\Provider\FlySystem\FlySystemFileStreamAccessTest::$filesystemMock |
|
private |
◆ $subject
The documentation for this class was generated from the following file: