コード例 #1
0
 /**
  */
 public function testAll()
 {
     $limit = 10;
     $offset = 0;
     $orderBy = null;
     /** @var EntityInterface|ObjectProphecy $entity1 */
     $entity1 = $this->prophesize('AppBundle\\Entity\\EntityInterface');
     /** @var EntityInterface|ObjectProphecy $entity2 */
     $entity2 = $this->prophesize('AppBundle\\Entity\\EntityInterface');
     $entityList = array($entity1->reveal(), $entity2->reveal());
     $this->repository->all($limit, $offset, $orderBy)->willReturn($entityList)->shouldBeCalledTimes(1);
     $this->assertSame($entityList, $this->manager->all($limit, $offset, $orderBy));
 }
コード例 #2
0
ファイル: ObjectManager.php プロジェクト: JahHub/fertilizer
 /**
  * Get a list of entity.
  *
  * @param int        $limit
  * @param int        $page
  * @param array|null $orderBy
  *
  * @return array
  */
 public function all($limit = 5, $page = 1, $orderBy = null)
 {
     return $this->repository->all($limit, $page, $orderBy);
 }