30 require_once __DIR__ .
'/../AbstractBaseTest.php';
35 private const INSIDE = __DIR__ .
'/files/inside/';
36 private const OUTSIDE = __DIR__ .
'/files/outside/';
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());
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());
86 $this->expectException(\InvalidArgumentException::class);
88 $sif->check(
'loremipsum');
96 $this->assertInstanceOf(Token::class, $tof->lease($file_stream_inside));
97 $this->expectException(\InvalidArgumentException::class);
98 $tof->lease($file_stream_outside);
Class ResourceBuilderTest.
Class FlavourMachineTest.
static ofResource($resource)
Wraps an already created resource with the stream abstraction.
testStreamAccessInfoOutsideDirectory()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
testStreamAccessInfoWrongDirectory()
static ofString(string $string)
Creates a new stream with an initial value.