4
4
* @copyright Copyright (C) Ibexa AS. All rights reserved.
5
5
* @license For full copyright and license information view LICENSE file distributed with this source code.
6
6
*/
7
+ declare (strict_types=1 );
7
8
8
9
namespace Ibexa \Tests \Bundle \IO \EventListener ;
9
10
19
20
use Symfony \Component \HttpKernel \Event \RequestEvent ;
20
21
use Symfony \Component \HttpKernel \HttpKernelInterface ;
21
22
22
- class StreamFileListenerTest extends TestCase
23
+ /**
24
+ * @covers \Ibexa\Bundle\IO\EventListener\StreamFileListener
25
+ */
26
+ final class StreamFileListenerTest extends TestCase
23
27
{
24
28
private StreamFileListener $ eventListener ;
25
29
@@ -36,6 +40,9 @@ protected function setUp(): void
36
40
$ this ->eventListener = new StreamFileListener ($ this ->ioServiceMock , $ this ->ioConfigResolverMock );
37
41
}
38
42
43
+ /**
44
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\Exception
45
+ */
39
46
public function testDoesNotRespondToNonIoUri (): void
40
47
{
41
48
$ request = $ this ->createRequest ('/Not-an-image ' );
@@ -51,6 +58,9 @@ public function testDoesNotRespondToNonIoUri(): void
51
58
self ::assertNull ($ event ->getResponse ());
52
59
}
53
60
61
+ /**
62
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\Exception
63
+ */
54
64
public function testDoesNotRespondToNoIoRequest (): void
55
65
{
56
66
$ request = $ this ->createRequest ('/Not-an-image ' , 'bar.fr ' );
@@ -66,6 +76,9 @@ public function testDoesNotRespondToNoIoRequest(): void
66
76
self ::assertNull ($ event ->getResponse ());
67
77
}
68
78
79
+ /**
80
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\Exception
81
+ */
69
82
public function testRespondsToIoUri (): void
70
83
{
71
84
$ uri = $ binaryFileUri = '/var/test/storage/images/image.png ' ;
@@ -75,6 +88,9 @@ public function testRespondsToIoUri(): void
75
88
$ this ->assertOnKernelRequestResponse ($ request , $ urlPrefix , $ binaryFileUri );
76
89
}
77
90
91
+ /**
92
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\Exception
93
+ */
78
94
public function testRespondsToIoRequest (): void
79
95
{
80
96
$ uri = '/var/test/storage/images/image.png ' ;
@@ -109,6 +125,9 @@ protected function createEvent(Request $request): RequestEvent
109
125
);
110
126
}
111
127
128
+ /**
129
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\Exception
130
+ */
112
131
private function assertOnKernelRequestResponse (Request $ request , string $ urlPrefix , string $ binaryFileUri ): void
113
132
{
114
133
$ this ->configureIoUrlPrefix ($ urlPrefix );
0 commit comments