public function testEmptyPager() { $pager = new Pager(0); $pager->setPageSize(2)->setPageRange(5); $this->assertEquals([], $pager->getPagesInRange()); }
public function testPagedTraversal_ServerReturnsError_ThrowsException() { $traversal = new Traversal($this->client); $traversal->setOrder(Traversal::OrderDepthFirst); $node = new Node($this->client); $node->setId(1); $pager = new Pager($traversal, $node, Traversal::ReturnTypeNode); $pager->setPageSize(1)->setLeaseTime(30); $this->transport->expects($this->once())->method('post')->with('/node/1/paged/traverse/node?pageSize=1&leaseTime=30', array("order" => "depth_first"))->will($this->returnValue(array("code" => 400))); $this->setExpectedException('Everyman\\Neo4j\\Exception'); $result = $this->client->executePagedTraversal($pager); }