Testing defaultValidation and buildRules


Hello, I’ve been trying cakephp 3 since yesterday. And I’m interested to use the unit testing.

I have succeed test my add action. But, I have difficulties on tracking if there are some validation errors.

public function testAdd()
    // $this->markTestIncomplete('Not implemented yet.');
    $this->post('/patients/add', $this->data);

    $patients = TableRegistry::get('Patients');
    $results = $query = $patients->get(619619)->toArray();

    $this->assertEquals($this->data, $results);

    //if success, the action should be redirected to index
    $this->assertRedirect(['controller' => 'Patients', 'action' => 'index']);


How could I make a test for testDefaultValidation() and buildRules(), since their content only $this->markTestIncomplete('Not implemented yet.'); ??

Thank you.