Beispiel #1
0
 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]);
 }
Beispiel #2
0
 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));
 }