PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Tue Sep 18, 2018 3:22 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Mon Aug 31, 2009 4:46 am 
Offline
Forum Newbie

Joined: Mon Aug 31, 2009 4:33 am
Posts: 2
HI,
I'm newbie to testing. I have been using PHPUnit for my PHP web application. I could test my webpages with selenium-RC. Can I test on database ? Say, I have products table, if there is any filter (category wise, title wise) in my webpage which would filter products by category & title. How can I test this filter is working properly or not? This is just sample case, I have many cases in my web-application.

If PHPUnit is not efficient for database testing, could anyone suggest you the efficient test tool.


Top
 Profile  
 
PostPosted: Wed Sep 09, 2009 2:44 am 
Offline
Forum Newbie

Joined: Mon Aug 31, 2009 4:33 am
Posts: 2
Hi, As I'm pretty new to database testing, I don't know how to prepare "database states"? In my site, mysql database is used.

When I searched, I found some code, but my database type is mysql not pdo_mysql.

Syntax: [ Download ] [ Hide ]
class BankAccountDBTest extends PHPUnit_Extensions_Database_TestCase
{
        protected $pdo;
           
        public function __construct()
        {
                $this->pdo = new PDO('mysql::memory:');
                BankAccount::createTable($this->pdo);
        }
 
        protected function getConnection()
        {
                return $this->createDefaultDBConnection($this->pdo, 'mysql');
        }
        .........................
 
}
 

How should I modify & how to test my requirement as I asked in my first post?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group