home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / Servidores / xampp-win32-1.6.7-installer.exe / phpMyAdmin / test / PMA_transformation_getOptions_test.php < prev    next >
Encoding:
PHP Script  |  2008-06-23  |  1.2 KB  |  48 lines

  1. <?php
  2. /* vim: expandtab sw=4 ts=4 sts=4: */
  3. /**
  4.  * tests for PMA_sanitize()
  5.  *
  6.  * @version $Id: PMA_sanitize_test.php 10140 2007-03-20 08:32:55Z cybot_tm $
  7.  * @package phpMyAdmin-test
  8.  */
  9.  
  10. /**
  11.  *
  12.  */
  13. require_once 'PHPUnit/Framework.php';
  14. require_once './libraries/transformations.lib.php';
  15.  
  16. class PMA_transformation_getOptions_test extends PHPUnit_Framework_TestCase
  17. {
  18.     public function testDefault()
  19.     {
  20.         $this->assertEquals(array('option1 ', ' option2 '),
  21.             PMA_transformation_getOptions("option1 , option2 "));
  22.     }
  23.  
  24.     public function testQuoted()
  25.     {
  26.         $this->assertEquals(array('option1', ' option2'),
  27.             PMA_transformation_getOptions("'option1' ,' option2' "));
  28.     }
  29.  
  30.     public function testComma()
  31.     {
  32.         $this->assertEquals(array('2,3', ' ,, option ,,'),
  33.             PMA_transformation_getOptions("'2,3' ,' ,, option ,,' "));
  34.     }
  35.  
  36.     public function testEmptyOptions()
  37.     {
  38.         $this->assertEquals(array('', '', ''),
  39.             PMA_transformation_getOptions("'',,"));
  40.     }
  41.  
  42.     public function testEmpty()
  43.     {
  44.         $this->assertEquals(array(),
  45.             PMA_transformation_getOptions(''));
  46.     }
  47. }
  48. ?>