コード例 #1
0
ファイル: offsetUnsetTest.php プロジェクト: bogdananton/vsc
 public function testBasicOffsetUnset()
 {
     $key = 'test';
     $value = uniqid($key . ':');
     $a = [$key => $value];
     $o = new ArrayModel($a);
     $this->assertEquals($value, $o[$key]);
     $o->offsetUnset($key);
     $this->assertNull($o[$key]);
 }
コード例 #2
0
ファイル: offsetExistsTest.php プロジェクト: bogdananton/vsc
 public function testOffsetExistsWithAndWithoutCorrectKey()
 {
     $key = 'test';
     $value = uniqid($key . ':');
     $a = [$key => $value];
     $o = new ArrayModel($a);
     $this->assertTrue($o->offsetExists($key));
     $this->assertFalse($o->offsetExists(uniqid()));
     $o->offsetUnset($key);
     $this->assertFalse($o->offsetExists($key));
 }