Intro: I have a Yii webapp which I want to test using phpunit and selenium testing, but here is the catch, I do not use a DB. I communicate with an API which integrates with Yii’s activeRecord (ActiveResource, as it is my first post I cannot add a link to it).
Situation: So I have phpunit test working and I have a running Selenium stand alone server running as well. I do not use the FF plugin. I run it as a unit test:
<?php
class TestTest extends WebTestCase
{
public $fixtures=array(
//'posts'=>'Post',
);
public function testShow()
{
$this->open('site/login');
// verify the sample post title exists
$this->assertTextPresent($this->posts['sample1']['title']);
// verify comment form exists
$this->assertTextPresent('Password');
}
}
?>
But it keeps trying to connect to the database, which doesn’t exist. My webapp works fine without the database connection so I know it doesn’t need it.
Question:
So what I want to know is whether it is actually possible (I am new to Yii, but lots of MVC experience)?
How can I "set it up" to not look for a DB resource?
Has anyone done this and maybe have a few pointers or guide etc?
thanks alot!