I am testing controllers add method (CakePHP2.0).
But the issue is that what ever data I send as post gets added to my default databases and not my test database.
Heres the code.
public function testAdd() {
$data = array(
'Post' => array(
'title' => 'Fourth Post Title',
'body' => 'Fourth Post Body',
'created' => '2012-01-22 21:31:52'
)
);
$result = $this->testAction('/posts/add', array('data' => $data, 'method', 'post'));
debug($result);
}
What I was actually expecting that the posted data togo into test DB that i configured in database.php and not in default DB.