home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2005 June / PCpro_2005_06.ISO / files / opensource / xamp / xampp-win32.exe / xampp / GetQueryString.php < prev    next >
Encoding:
PHP Script  |  2004-10-01  |  2.1 KB  |  55 lines

  1. <?php
  2. // +----------------------------------------------------------------------+
  3. // | PHP Version 4                                                        |
  4. // +----------------------------------------------------------------------+
  5. // | Copyright (c) 1997-2003 The PHP Group                                |
  6. // +----------------------------------------------------------------------+
  7. // | This source file is subject to version 2.02 of the PHP license,      |
  8. // | that is bundled with this package in the file LICENSE, and is        |
  9. // | available at through the world-wide-web at                           |
  10. // | http://www.php.net/license/2_02.txt.                                 |
  11. // | If you did not receive a copy of the PHP license and are unable to   |
  12. // | obtain it through the world-wide-web, please send a note to          |
  13. // | license@php.net so we can mail you a copy immediately.               |
  14. // +----------------------------------------------------------------------+
  15. // | Author:  Wolfram Kriesing <wolfram@kriesing.de>                      |
  16. // +----------------------------------------------------------------------+
  17. //
  18. // $Id: GetQueryString.php,v 1.1 2003/09/23 11:18:20 cain Exp $
  19. //
  20.  
  21. /**
  22. * This class just checks if the query is returned, not if
  23. * the query was properly rendered. This should be subject to
  24. * some other tests!
  25. *
  26. * @package tests
  27. */
  28. class tests_GetQueryString extends tests_UnitTest
  29. {
  30.     function _setup()
  31.     {
  32.         $this->question =& new tests_Common(TABLE_QUESTION);
  33.     }
  34.  
  35.     function test_selectAll()
  36.     {
  37.         $this->_setup();
  38.         $this->assertStringEquals(
  39.                             'SELECT question.id AS "id",question.question AS "question" FROM question'
  40.                             ,$this->question->getQueryString());
  41.     }
  42.  
  43.     function test_selectWithWhere()
  44.     {
  45.         $this->_setup();
  46.         $this->question->setWhere('id=1');
  47.         $this->assertStringEquals(
  48.                             'SELECT question.id AS "id",question.question AS "question" FROM question'.
  49.                             ' WHERE id=1'
  50.                             ,$this->question->getQueryString());
  51.     }
  52. }
  53.  
  54. ?>
  55.