public function testArrayAccess()
 {
     $this->assertCount(3, $this->collection);
     foreach ([0, 1, 2] as $key) {
         $this->assertTrue(isset($this->collection[$key]));
         $this->assertInstanceOf(Account::class, $this->collection[$key]);
         $this->collection[$key] = new Source(\Mockery::mock(Transport::class), '');
         $this->assertInstanceOf(Source::class, $this->collection[$key]);
     }
     unset($this->collection[2]);
     unset($this->collection[1]);
     unset($this->collection[0]);
     $this->assertCount(0, $this->collection);
     $this->assertNull($this->collection->key());
 }
Beispiel #2
0
 /** {@inheritdoc} */
 public function offsetUnset($offset)
 {
     $this->all($this->query);
     return $this->collection->offsetUnset($offset);
 }