コード例 #1
0
ファイル: offsetGetTest.php プロジェクト: bogdananton/vsc
 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]);
 }
コード例 #2
0
ファイル: offsetSetTest.php プロジェクト: bogdananton/vsc
 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]);
 }