public function testGetWithoutStorage() { $this->manager = new FilterManager(); $grid = $this->createGridMock(); $grid->expects($this->once())->method('getData')->will($this->returnValue($filters = ['foo' => 'bar'])); $this->assertSame($filters, $this->manager->get($grid)); }
public function testGetWithoutCache() { $grid = $this->createGridMock(); $grid->expects($this->once())->method('getResource')->will($this->returnValue($resource = $this->createResourceMock())); $resource->expects($this->once())->method('getName')->will($this->returnValue($name = 'name')); $this->storage->expects($this->once())->method('offsetExists')->with($this->identicalTo('_lug_grid_filter_' . $name))->will($this->returnValue(false)); $grid->expects($this->once())->method('getData')->will($this->returnValue($filters = ['foo' => 'bar'])); $this->assertSame($filters, $this->manager->get($grid)); }