Skip to content

Commit

Permalink
Test ProtectedGlobal offsetUnset
Browse files Browse the repository at this point in the history
  • Loading branch information
g105b committed Dec 5, 2018
1 parent c95ea9e commit 1c1bad0
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/unit/ProtectedGlobalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,21 @@ public function testOffsetUnsetThrowsException() {
self::expectException(ProtectedGlobalException::class);
unset($sut["something"]);
}

public function testOffsetUnset() {
$whiteList = [
"name" => "test",
"country" => "United Kingdom",
];
$sut = new ProtectedGlobal($whiteList);

$exception = null;

try {
unset($sut["name"]);
}
catch(\Exception $exception) {}

self::assertNull($exception);
}
}

0 comments on commit 1c1bad0

Please sign in to comment.