public function testIterate()
 {
     $itemMock = $this->getMock('stdClass', array('test'));
     $itemMock->expects($this->once())->method('test');
     $items = array($itemMock);
     $iteratorable = $this->getMock('SimplePHPEasyPlus\\Iterator\\IteratorableInterface', array('getItems'), array(), '');
     $iteratorable->expects($this->once())->method('getItems')->will($this->returnValue($items));
     $closure = function ($item) {
         $item->test();
     };
     $iterator = new CallbackIterator($closure);
     $iterator->iterate($iteratorable);
 }
Esempio n. 2
0
 /**
  * @param callable $currentPage
  * @param callable $nextPage
  * @param callable $currentPageKey
  * @param callable $totalPages
  * @param callable $setCurrentPage
  */
 public function __construct(callable $currentPage, callable $nextPage, callable $currentPageKey, callable $totalPages, callable $setCurrentPage)
 {
     parent::__construct($currentPage, $nextPage, $currentPageKey, $totalPages, $setCurrentPage);
 }