home *** CD-ROM | disk | FTP | other *** search
/ Enter 2004 June / ENTER.ISO / files / xampp-win32-1.4.5-installer.exe / xampp / db_ismanip.phpt < prev    next >
Encoding:
Text File  |  2004-03-24  |  1.2 KB  |  58 lines

  1. --TEST--
  2. DB::isManip
  3. --SKIPIF--
  4. <?php chdir(dirname(__FILE__)); require_once './skipif.inc'; ?>
  5. --FILE--
  6. <?php // -*- C++ -*-
  7. require_once './include.inc';
  8. require_once 'DB.php';
  9.  
  10. function test($query) {
  11.     printf("%s : %d\n", preg_replace('/\s+.*/', '', $query),
  12.            DB::isManip($query));
  13. }
  14.  
  15. print "testing DB::isManip...\n";
  16.  
  17. test("SELECT * FROM table");
  18. test("Select * from table");
  19. test("select * From table");
  20. test("sElECt * frOm table");
  21. test("SELECT DISTINCT name FROM table");
  22. test("UPDATE table SET foo = 'bar'");
  23. test("DELETE FROM table");
  24. test("delete from table where id is null");
  25. test("create table (id integer, name varchar(100))");
  26. test("CREATE SEQUENCE foo");
  27. test("\"CREATE PROCEDURE foo\"");
  28. test("GRANT SELECT ON table TO user");
  29. test("REVOKE SELECT ON table FROM user");
  30. test("SHOW OPTIONS");
  31. test("DROP TABLE foo");
  32. test("ALTER TABLE foo ADD COLUMN (bar INTEGER)");
  33. test("  SELECT * FROM table");
  34. test("  DELETE FROM table");
  35. ?>
  36. --GET--
  37. --POST--
  38. --EXPECT--
  39. testing DB::isManip...
  40. SELECT : 0
  41. Select : 0
  42. select : 0
  43. sElECt : 0
  44. SELECT : 0
  45. UPDATE : 1
  46. DELETE : 1
  47. delete : 1
  48. create : 1
  49. CREATE : 1
  50. "CREATE : 1
  51. GRANT : 1
  52. REVOKE : 1
  53. SHOW : 0
  54. DROP : 1
  55. ALTER : 1
  56.  : 0
  57.  : 1
  58.