Exemple #1
0
 public function testBasicOffsetSet()
 {
     $key = 'test';
     $value = uniqid($key . ':');
     //		$a = [$key => $value];
     $o = new ArrayModel();
     $this->assertFalse($o->offsetExists($key));
     $o->offsetSet($key, $value);
     $this->assertTrue($o->offsetExists($key));
     $this->assertEquals($value, $o[$key]);
 }
Exemple #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));
 }