Example #1
0
 public function testAppendPrependCall()
 {
     $collection = new Collection();
     $this->assertEquals([], $collection->toArray());
     $this->assertEquals(0, count($collection));
     $collection->append(1);
     $this->assertEquals([1], $collection->toArray());
     $this->assertEquals(1, count($collection));
     $collection->prepend(2);
     $this->assertEquals([2, 1], $collection->toArray());
     $this->assertEquals(2, count($collection));
     $collection = new Collection();
     $collection->append(new Int(1));
     $collection->append(new Int(2));
     $collection->append(new Int(3));
     $collectionExpected = new Collection();
     $collectionExpected->append(new Int(2));
     $collectionExpected->append(new Int(3));
     $collectionExpected->append(new Int(4));
     $collection->increment();
     $this->assertEquals($collectionExpected, $collection);
 }
Example #2
0
 public function testCall()
 {
     $collection = new Collection();
     $collection->append(new Number(1));
     $collection->append(new Number(2));
     $collection->append(new Number(3));
     $collectionExpected = new Collection();
     $collectionExpected->append(new Number(2));
     $collectionExpected->append(new Number(3));
     $collectionExpected->append(new Number(4));
     $collection->increment();
     $this->assertEquals($collectionExpected, $collection);
 }