public function testOffsetGetWithAndWithoutSetValue() { $key = 'test'; $value = uniqid($key . ':'); $o = new ArrayModel(); $this->assertNull($o->offsetGet($key)); $o->offsetSet($key, $value); $this->assertEquals($value, $o->offsetGet($key)); $this->assertEquals($value, $o[$key]); }
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]); }