public function testGetWithQueryModification()
{
$this->_eventManager->on('Dispatcher.invokeController', ['priority' => 1000], function () {
$this->_controller->Crud->on('beforeLookup', function ($event) {
$event->subject->query->where(['id <' => 2]);
});
});
$expected = ['1' => '1st post'];
$this->get('/blogs/lookup.json');
$this->assertNotNull($this->viewVariable('viewVar'));
$this->assertEquals($expected, $this->viewVariable('blogs')->toArray());
}