It's weird... When I did like you said Martin, didn't work, but if i
write something like:
public function testIndex() {
$result = $this->testAction('/news/index', array(
'connection' => 'test',
'return' => 'vars',
'method' => 'get'
));
debug($result);
}
It's looks like test DB working. What's going on with this
"fixturize=>true"?
Martin - thx for suggestion. :)
On 12 Lut, 14:03, Martin Radosta <[email protected]> wrote:
> try adding the connection to the array
>
> public function testIndex() {
> $result = $this->testAction('/news/index', array(
> 'connection' => 'test',
> 'fixturize' => true,
> 'return' => 'vars'
> ));
> debug($result);
>
> }
> On Thu, Feb 12, 2009 at 8:12 AM, Raph <[email protected]> wrote:
>
> > I have a problem with using fixtures in my controller test. When I use
> > fixtures in my model test everything is ok (tests pass without
> > exectpions), but in controller tests I have exceptions in tests with
> > table missing errors.
>
> > I read posts about issues like mine which suggest that it was fixed,
> > but I have last release of Cake and it dosen't help.
>
> > This is code of my controller test:
>
> > class NewsControllerTestCase extends CakeTestCase {
> > public $fixtures = array('app.news');
>
> > public function startCase() {
> > echo '<h1>Starting Test Case</h1>';
> > }
>
> > public function endCase() {
> > echo '<h1>Ending Test Case</h1>';
> > }
>
> > public function startTest($method) {
>
> > echo '<h3>Starting method ' . $method . '</h3>';
> > }
>
> > public function endTest($method) {
> > echo '<hr />';
> > }
>
> > public function testIndex() {
> > $result = $this->testAction('/news/index', array(
> > 'fixturize' => true,
> > 'return' => 'vars'
> > ));
> > debug($result);
> > }
> > }
>
> > I have error "Table 'test_db.news' doesn't exist" three times.
>
> > Any ideas?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---