コード例 #1
0
 /**
  * @covers       CollectionType\Iterator\IteratorAbstract::isEmpty
  */
 public function testIsEmptyForFewValues()
 {
     $this->iterator->add('A');
     $this->iterator->add('B');
     $result = $this->iterator->isEmpty();
     $this->assertFalse($result);
 }
コード例 #2
0
 /**
  * @covers       CollectionType\Iterator\IteratorAbstract::next
  */
 public function testNextForFewValues()
 {
     $this->iterator->add('A');
     $this->iterator->add('B');
     $this->iterator->add('C');
     $result = $this->iterator->next();
     $this->assertEquals('B', $result);
 }
コード例 #3
0
 /**
  * @covers       CollectionType\Iterator\IteratorAbstract::clear
  */
 public function testClear()
 {
     $this->iterator->add('A');
     $this->iterator->add('B');
     $this->iterator->clear();
     $result = $this->iterator->count();
     $this->assertEquals(0, $result);
 }
コード例 #4
0
 /**
  * @covers       CollectionType\Iterator\IteratorAbstract::rewind
  */
 public function testRewindForFewValuesAfterCallNextMethod()
 {
     $this->iterator->add('A');
     $this->iterator->add('B');
     $this->iterator->add('C');
     $this->iterator->next();
     $this->iterator->next();
     $result = $this->iterator->rewind();
     $this->assertEquals('A', $result);
 }
コード例 #5
0
 /**
  * @covers       CollectionType\Iterator\IteratorAbstract::count
  */
 public function testCountForManyValues()
 {
     $this->iterator->add('A');
     $this->iterator->add('B');
     $this->iterator->add('C');
     $this->iterator->add('D');
     $this->iterator->add('E');
     $result = $this->iterator->count();
     $this->assertEquals(5, $result);
 }
コード例 #6
0
ファイル: GetTest.php プロジェクト: mparulski/collection-type
 /**
  * @covers       CollectionType\Iterator\IteratorAbstract::getIterator
  */
 public function testGetIterator()
 {
     $result = $this->iterator->getIterator();
     $this->assertInstanceOf('\\ArrayIterator', $result);
 }