Crud\TestCase\Controller\Crud\CrudComponentTest::testUseModel PHP Method

testUseModel() public method

Tests that is possible to set the model class to use for the action
public testUseModel ( ) : void
return void
    public function testUseModel()
    {
        $this->Crud = new CrudComponent($this->Registry, ['actions' => ['Crud.Index']]);
        $this->Crud->beforeFilter(new Event('Controller.beforeFilter'));
        $this->controller->Crud = $this->Crud;
        $class = $this->getMockClass('Model');
        $this->Crud->useModel($class);
        $this->assertEquals($class, $this->Crud->table()->alias());
    }