home *** CD-ROM | disk | FTP | other *** search
/ Enter 2004 June / ENTER.ISO / files / xampp-win32-1.4.5-installer.exe / xampp / GetQueryString.php < prev    next >
Encoding:
PHP Script  |  2004-03-24  |  1.0 KB  |  40 lines

  1. <?php
  2. //
  3. // $Id: GetQueryString.php,v 1.1 2004/03/17 15:12:05 quipo Exp $
  4. //
  5.  
  6. /**
  7. * This class just checks if the query is returned, not if
  8. * the query was properly rendered. This should be subject to
  9. * some other tests!
  10. *
  11. * @package tests
  12. */
  13. class tests_GetQueryString extends tests_UnitTest
  14. {
  15.     function _setup()
  16.     {
  17.         $this->question =& new tests_Common(TABLE_QUESTION);
  18.     }
  19.  
  20.     function test_selectAll()
  21.     {
  22.         $this->_setup();
  23.         $this->assertStringEquals(
  24.                             'SELECT question.id AS "id",question.question AS "question" FROM question',
  25.                             $this->question->getQueryString());
  26.     }
  27.  
  28.     function test_selectWithWhere()
  29.     {
  30.         $this->_setup();
  31.         $this->question->setWhere('id=1');
  32.         $this->assertStringEquals(
  33.                             'SELECT question.id AS "id",question.question AS "question" FROM question'.
  34.                             ' WHERE id=1',
  35.                             $this->question->getQueryString());
  36.     }
  37. }
  38.  
  39. ?>
  40.