示例#1
0
 /**
  * @covers Object_AbstractDelegator::offsetExists
  */
 public function testOffsetExists()
 {
     $this->object->append('For_Test');
     $this->object->append(new stdClass());
     $this->assertTrue($this->object->offsetExists(0));
     $this->assertTrue($this->object->offsetExists(1));
     $this->assertFalse($this->object->offsetExists(2));
     $this->object->getIterator();
     $this->assertTrue($this->object->offsetExists(0));
     $this->assertTrue($this->object->offsetExists(1));
     $this->assertFalse($this->object->offsetExists(2));
 }
示例#2
0
文件: Object.php 项目: techart/tao
 /**
  * Проверяет существование объекта по индексу
  *
  * @param  null|int|string $index
  *
  * @return boolean
  */
 public function offsetExists($index)
 {
     return parent::offsetExists($index) || $this->fallback instanceof self && isset($this->fallback[$index]);
 }