Tags
Tags copied to clipboard
Tests failing when using model with TagBehavior
I am getting following errors when running app test on Users controller, which uses Users Table with TagBehavior loaded
RuntimeException: Field "tag_count" does not exist in table "users"
Test setUp
public function setUp()
{
parent::setUp();
$request = new ServerRequest();
$response = new Response();
$this->controller = new UsersController($request, $response);
$event = new Event('Controller.beforeFilter', $this->controller);
$this->controller->beforeFilter($event);
$event = new Event('Controller.beforeRender', $this->controller);
$this->controller->beforeRender($event);
}
Possible fix:
- removing above exception?
- I can load the Table without behavior for that controller for the test, but I think it is better to load default behaviors
Check your fixture if it has the field.