Exemplo n.º 1
0
 /**
  * Checks adding and removing items works correctly.
  *
  * @depends testInstantiateWithOneItem
  */
 public function testAddingAndRemovingItems(Collection $collection)
 {
     $values = [0 => "hello"];
     $collection->add('hello again');
     $this->assertEquals(array_merge($values, ['hello again']), $collection->all());
     $this->assertEquals(2, $collection->count());
     $this->assertCount(2, $collection);
     $this->assertSame($collection, $collection->remove(0));
     $this->assertEquals(1, $collection->count());
     $this->assertCount(1, $collection);
 }