File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ declare (strict_types=1 );
4
+
5
+ namespace Yokai \Batch \Tests \Test ;
6
+
7
+ use PHPUnit \Framework \TestCase ;
8
+ use Psr \Container \NotFoundExceptionInterface ;
9
+ use Yokai \Batch \Test \ArrayContainer ;
10
+
11
+ class ArrayContainerTest extends TestCase
12
+ {
13
+ public function testGet (): void
14
+ {
15
+ $ container = new ArrayContainer (['foo ' => 'FOO ' , 'bar ' => 'BAR ' ]);
16
+
17
+ self ::assertSame ('FOO ' , $ container ->get ('foo ' ));
18
+ self ::assertSame ('BAR ' , $ container ->get ('bar ' ));
19
+ }
20
+
21
+ public function testGetNotFound (): void
22
+ {
23
+ $ container = new ArrayContainer (['foo ' => 'FOO ' , 'bar ' => 'BAR ' ]);
24
+
25
+ self ::expectException (NotFoundExceptionInterface::class);
26
+ $ container ->get ('baz ' );
27
+ }
28
+
29
+ public function testHas (): void
30
+ {
31
+ $ container = new ArrayContainer (['foo ' => 'FOO ' , 'bar ' => 'BAR ' ]);
32
+
33
+ self ::assertSame (true , $ container ->has ('foo ' ));
34
+ self ::assertSame (true , $ container ->has ('bar ' ));
35
+ self ::assertSame (false , $ container ->has ('baz ' ));
36
+ }
37
+ }
You can’t perform that action at this time.
0 commit comments