Yii Framework Forum: Selenium Phpunit Testing Without Db - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Selenium Phpunit Testing Without Db

#1 User is offline   We0 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 24-June 13

Posted 09 July 2013 - 08:49 AM

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!
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users