/** * @expectedException \RuntimeException * @expectedExceptionMessage Unable to find layout "UnknownLayoutClass" */ public function testGetLayoutMethodShouldWithInvalidLayoutClassShouldThrowException() { // stub paginate $paginate = new stdClass(); $paginate->total_pages = 20; $paginate->current = 1; $mock = Mockery::mock(self::BUILDER_CLASS); $mock->shouldReceive('getPaginate')->once()->andReturn($paginate); $mock->shouldReceive('getLimit')->once()->andReturn(null); $pager = new Pager($mock, ['rangeLength' => 5, 'layoutClass' => 'UnknownLayoutClass', 'urlMask' => 'xxx']); $pager->getLayout(); }