public function testEnabledActionWorks()
{
$Request = $this->getMockBuilder('Cake\\Network\\Request')->setMethods(['method'])->getMock();
$Request->action = 'add';
$Request->expects($this->once())->method('method')->will($this->returnValue('GET'));
$Action = $this->getMockBuilder('Crud\\Action\\BaseAction')->setMethods(['_request', '_get'])->setConstructorArgs([$this->Controller])->getMock();
$Action->expects($this->any())->method('_request')->with()->will($this->returnValue($Request));
$Action->expects($this->once())->method('_get', '_handle was never called on a enabled action')->will($this->returnValue(true));
$this->_configureAction($Action);
$Action->config('action', 'add');
$expected = true;
$actual = $Action->config('enabled');
$this->assertSame($expected, $actual, 'The action is not enabled by default');
$expected = true;
$actual = $Action->handle();
$this->assertSame($expected, $actual, 'Calling handle on a disabled action did not return null');
}