/**
  * @test
  */
 public function findTheLastPage()
 {
     $pageMock = $this->getMock('TEIShredder\\Page');
     $pdoStatementMock = $this->getMockBuilder('PDOStatement')->getMock();
     $pdoStatementMock->expects($this->once())->method('setFetchMode')->with($this->isType('int'), $this->isInstanceOf('TEIShredder\\Page'));
     $pdoStatementMock->expects($this->once())->method('fetch')->with()->will($this->returnValue($pageMock));
     $pdoMock = $this->getMockBuilder('PDO')->setConstructorArgs(array('sqlite::memory:'))->getMock();
     $pdoMock->expects($this->once())->method('query')->will($this->returnValue($pdoStatementMock));
     $setup = new Setup($pdoMock);
     $obj = new PageGateway($setup->database, $setup->factory, $setup->prefix);
     $actual = $obj->findLastPage();
     $this->assertInstanceOf('TEIShredder\\Page', $actual);
 }