Class FlavourMachineTest.
More...
Class FlavourMachineTest.
- Author
- Fabian Schmid fabia.nosp@m.n@sr.nosp@m..solu.nosp@m.tion.nosp@m.s
Definition at line 32 of file AccessTokenTest.php.
◆ testMemoryStream()
ILIAS\ResourceStorage\Flavours\AccessTokenTest::testMemoryStream |
( |
| ) |
|
Definition at line 40 of file AccessTokenTest.php.
References $token, and ILIAS\Filesystem\Stream\Streams\ofString().
42 $tof =
new TokenFactory(__DIR__);
45 $token = $tof->lease($file_stream);
47 $this->assertFalse(
$token->hasStreamableStream());
48 $this->assertTrue(
$token->hasInMemoryStream());
50 $token_stream =
$token->resolveStream();
52 $this->assertFalse(
$token->hasStreamableStream());
54 $this->assertTrue($token_stream->isReadable());
55 $this->assertFalse($token_stream->isWritable());
56 $this->assertEquals(
'application/x-empty', $token_stream->getMimeType());
static ofString(string $string)
Creates a new stream with an initial value.
◆ testRealStream()
ILIAS\ResourceStorage\Flavours\AccessTokenTest::testRealStream |
( |
| ) |
|
Definition at line 59 of file AccessTokenTest.php.
References $token, and ILIAS\Filesystem\Stream\Streams\ofResource().
61 $tof =
new TokenFactory(__DIR__);
65 $token = $tof->lease($file_stream);
66 $this->assertFalse(
$token->hasStreamableStream());
67 $this->assertFalse(
$token->hasInMemoryStream());
69 $token_stream =
$token->resolveStream();
71 $this->assertTrue(
$token->hasStreamableStream());
72 $this->assertFalse(
$token->hasInMemoryStream());
74 $this->assertTrue($token_stream->isReadable());
75 $this->assertFalse($token_stream->isWritable());
76 $this->assertEquals(
'image/svg+xml', $token_stream->getMimeType());
78 $token2 = $tof->lease($file_stream,
true);
79 $this->assertTrue(
$token->hasStreamableStream());
80 $this->assertFalse(
$token->hasInMemoryStream());
static ofResource($resource)
Wraps an already created resource with the stream abstraction.
◆ testStreamAccessInfoOutsideDirectory()
ILIAS\ResourceStorage\Flavours\AccessTokenTest::testStreamAccessInfoOutsideDirectory |
( |
| ) |
|
Definition at line 91 of file AccessTokenTest.php.
References ILIAS\Filesystem\Stream\Streams\ofResource().
93 $tof =
new TokenFactory(self::INSIDE);
96 $this->assertInstanceOf(Token::class, $tof->lease($file_stream_inside));
97 $this->expectException(\InvalidArgumentException::class);
98 $tof->lease($file_stream_outside);
static ofResource($resource)
Wraps an already created resource with the stream abstraction.
◆ testStreamAccessInfoWrongDirectory()
ILIAS\ResourceStorage\Flavours\AccessTokenTest::testStreamAccessInfoWrongDirectory |
( |
| ) |
|
Definition at line 84 of file AccessTokenTest.php.
86 $this->expectException(\InvalidArgumentException::class);
87 $sif =
new TokenFactory(
'/loremipsum/');
88 $sif->check(
'loremipsum');
◆ INSIDE
const ILIAS\ResourceStorage\Flavours\AccessTokenTest::INSIDE = __DIR__ . '/files/inside/' |
|
private |
◆ INSIDE_FILE
const ILIAS\ResourceStorage\Flavours\AccessTokenTest::INSIDE_FILE = self::INSIDE . self::TEST_SVG |
|
private |
◆ OUTSIDE
const ILIAS\ResourceStorage\Flavours\AccessTokenTest::OUTSIDE = __DIR__ . '/files/outside/' |
|
private |
◆ OUTSIDE_FILE
const ILIAS\ResourceStorage\Flavours\AccessTokenTest::OUTSIDE_FILE = self::OUTSIDE . self::TEST_SVG |
|
private |
◆ TEST_SVG
const ILIAS\ResourceStorage\Flavours\AccessTokenTest::TEST_SVG = 'test.svg' |
|
private |
The documentation for this class was generated from the following file: