Skip to content

Commit a9ec6f3

Browse files
Jean ClaveauJean Claveau
authored andcommitted
Unit tests for unused parts of ArrayAccess
1 parent 2f2381e commit a9ec6f3

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

tests/unit/DeferredCallChainTest.php

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,57 @@ public function test_jsonSerialize()
133133
);
134134
}
135135

136+
/**
137+
*/
138+
public function test_ArrayAccess_unimplemented_offsetExists()
139+
{
140+
try {
141+
$nameRobert = LaterHuman::new_();
142+
isset($nameRobert['property_that_could_not_be_tested']);
143+
$this->assertTrue(false, "An exception must have been thrown here");
144+
}
145+
catch (\Exception $e) {
146+
$this->assertEquals(
147+
"not implemented",
148+
$e->getMessage()
149+
);
150+
}
151+
}
152+
153+
/**
154+
*/
155+
public function test_ArrayAccess_unimplemented_offsetUnset()
156+
{
157+
try {
158+
$nameRobert = LaterHuman::new_();
159+
unset($nameRobert['property_that_could_not_be_unset']);
160+
$this->assertTrue(false, "An exception must have been thrown here");
161+
}
162+
catch (\Exception $e) {
163+
$this->assertEquals(
164+
"not implemented",
165+
$e->getMessage()
166+
);
167+
}
168+
}
169+
170+
/**
171+
*/
172+
public function test_ArrayAccess_unimplemented_offsetSet()
173+
{
174+
try {
175+
$nameRobert = LaterHuman::new_();
176+
$nameRobert['property_that_could_not_be_set'] = 'plop';
177+
$this->assertTrue(false, "An exception must have been thrown here");
178+
}
179+
catch (\Exception $e) {
180+
$this->assertEquals(
181+
"not implemented",
182+
$e->getMessage()
183+
);
184+
}
185+
}
186+
136187
/**/
137188
}
138189

0 commit comments

Comments
 (0)