File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -89,16 +89,16 @@ public function testArrayAccess()
89
89
$ this ->list [] = $ violation ;
90
90
91
91
$ this ->assertSame ($ violation , $ this ->list [0 ]);
92
- $ this ->assertTrue ( isset ( $ this ->list [ 0 ]) );
92
+ $ this ->assertArrayHasKey ( 0 , $ this ->list );
93
93
94
94
unset($ this ->list [0 ]);
95
95
96
- $ this ->assertFalse ( isset ( $ this ->list [ 0 ]) );
96
+ $ this ->assertArrayNotHasKey ( 0 , $ this ->list );
97
97
98
98
$ this ->list [10 ] = $ violation ;
99
99
100
100
$ this ->assertSame ($ violation , $ this ->list [10 ]);
101
- $ this ->assertTrue ( isset ( $ this ->list [ 10 ]) );
101
+ $ this ->assertArrayHasKey ( 10 , $ this ->list );
102
102
}
103
103
104
104
public function testToString ()
Original file line number Diff line number Diff line change @@ -62,15 +62,15 @@ public function testLegacyArrayAccess()
62
62
63
63
$ this ->assertSame ('Group 1 ' , $ sequence [0 ]);
64
64
$ this ->assertSame ('Group 2 ' , $ sequence [1 ]);
65
- $ this ->assertTrue ( isset ( $ sequence[ 0 ]) );
66
- $ this ->assertFalse ( isset ( $ sequence[ 2 ]) );
65
+ $ this ->assertArrayHasKey ( 0 , $ sequence );
66
+ $ this ->assertArrayNotHasKey ( 2 , $ sequence );
67
67
unset($ sequence [0 ]);
68
- $ this ->assertFalse ( isset ( $ sequence[ 0 ]) );
68
+ $ this ->assertArrayNotHasKey ( 0 , $ sequence );
69
69
$ sequence [] = 'Group 3 ' ;
70
- $ this ->assertTrue ( isset ( $ sequence[ 2 ]) );
70
+ $ this ->assertArrayHasKey ( 2 , $ sequence );
71
71
$ this ->assertSame ('Group 3 ' , $ sequence [2 ]);
72
72
$ sequence [0 ] = 'Group 1 ' ;
73
- $ this ->assertTrue ( isset ( $ sequence[ 0 ]) );
73
+ $ this ->assertArrayHasKey ( 0 , $ sequence );
74
74
$ this ->assertSame ('Group 1 ' , $ sequence [0 ]);
75
75
}
76
76
You can’t perform that action at this time.
0 commit comments