1 | <?php |
||
2 | |||
3 | namespace SimplifiedTests; |
||
4 | |||
5 | |||
6 | use CommonTestClass; |
||
7 | use kalanis\kw_input\Simplified; |
||
8 | |||
9 | |||
10 | class SessionAdapterTest extends CommonTestClass |
||
11 | { |
||
12 | public function testPass(): void |
||
13 | { |
||
14 | $data = new Simplified\SessionAdapter(); |
||
15 | $this->assertInstanceOf(\ArrayAccess::class, $data); |
||
16 | |||
17 | $data->foz = 'wuz'; |
||
0 ignored issues
–
show
Bug
Best Practice
introduced
by
![]() |
|||
18 | $this->assertTrue(isset($data->foz)); |
||
0 ignored issues
–
show
The property
foz does not exist on kalanis\kw_input\Simplified\SessionAdapter . Since you implemented __get , consider adding a @property annotation.
![]() |
|||
19 | $this->assertEquals('wuz', $data->foz); |
||
20 | unset($data->foz); |
||
21 | |||
22 | $data['ugg'] = 'huu'; |
||
23 | $this->assertTrue(isset($data['ugg'])); |
||
24 | $this->assertEquals('huu', $data['ugg']); |
||
25 | unset($data['ugg']); |
||
26 | |||
27 | $nullKey = 'bnm' . chr(0) . 'lkj'; |
||
28 | $data[$nullKey] = 'thd'; |
||
29 | $this->assertTrue(isset($data[$nullKey])); |
||
30 | $this->assertTrue(isset($data['bnmlkj'])); |
||
31 | $this->assertEquals('thd', $data[$nullKey]); |
||
32 | $this->assertEquals('thd', $data['bnmlkj']); |
||
33 | unset($data[$nullKey]); |
||
34 | |||
35 | $data->gsr = 'vfr'; |
||
0 ignored issues
–
show
The property
gsr does not exist on kalanis\kw_input\Simplified\SessionAdapter . Since you implemented __set , consider adding a @property annotation.
![]() |
|||
36 | $this->assertNotEmpty(iterator_to_array($data->getIterator())); |
||
37 | unset($data->gsr); |
||
0 ignored issues
–
show
The property
gsr does not exist on kalanis\kw_input\Simplified\SessionAdapter . Since you implemented __get , consider adding a @property annotation.
![]() |
|||
38 | $this->assertEmpty(iterator_to_array($data->getIterator())); |
||
39 | } |
||
40 | |||
41 | public function testIterator(): void |
||
42 | { |
||
43 | $data = new Simplified\SessionAdapter(); |
||
44 | |||
45 | $this->assertEmpty(iterator_to_array($data->getIterator())); |
||
46 | $data->foz = 'wuz'; |
||
0 ignored issues
–
show
The property
foz does not exist on kalanis\kw_input\Simplified\SessionAdapter . Since you implemented __set , consider adding a @property annotation.
![]() |
|||
47 | $this->assertNotEmpty(iterator_to_array($data->getIterator())); |
||
48 | unset($data->foz); |
||
0 ignored issues
–
show
The property
foz does not exist on kalanis\kw_input\Simplified\SessionAdapter . Since you implemented __get , consider adding a @property annotation.
![]() |
|||
49 | $this->assertEmpty(iterator_to_array($data->getIterator())); |
||
50 | } |
||
51 | } |
||
52 |