Newer
Older
sqlmarker / UsedCars / Test_classes / Sale / UsedCars_Test_Sale.php
  1. <?php
  2. require_once "Schema.php";
  3.  
  4. abstract class STINK_student_records_Test_Teach extends PHPUnit_Extensions_Database_TestCase_CreateTable
  5. {
  6. public function getTableName()
  7. {
  8. return 'TEACH';
  9. }
  10. public function getColumnList()
  11. {
  12. return array(
  13. // No need to test legal values because of the FK. If the FK is missing it's broken anyway!
  14. 'STAFF_ID' => array( 'generic_type' => 'NUMBER',
  15. 'sql_type' => array( 'NUMBER', 'INTEGER' ),
  16. 'min_length' => 7,
  17. 'max_length' => 7,
  18. 'decimals' => 0,
  19. 'nullable' => false,
  20. 'test_value' => "1234569", ),
  21. // No need to test legal values because of the FK. If the FK is missing it's broken anyway!
  22. 'PAPER_CODE' => array( 'generic_type' => 'TEXT',
  23. 'sql_type' => array( 'CHAR', 'VARCHAR2', 'VARCHAR' ),
  24. 'min_length' => 7,
  25. 'max_length' => 7,
  26. 'nullable' => false,
  27. 'test_value' => "COMP160", ),
  28. 'YEAR_TAUGHT' => array( 'generic_type' => 'NUMBER',
  29. 'sql_type' => array( 'NUMBER', 'INTEGER' ),
  30. 'min_length' => 4,
  31. 'max_length' => 4,
  32. 'decimals' => 0,
  33. 'underflow' => 1981,
  34. 'overflow' => 10000,
  35. 'legal_values' => array( 1982 ),
  36. 'nullable' => false,
  37. 'test_value' => "2012", ),
  38. 'ROLE' => array( 'generic_type' => 'TEXT',
  39. 'sql_type' => array( 'VARCHAR2', 'VARCHAR' ),
  40. 'min_length' => 11,
  41. 'nullable' => false,
  42. 'legal_values' => array( 'Coordinator', 'Lecturer', 'Tutor' ),
  43. 'illegal_values'=> array( 'coordinator', 'COORDINATOR', 'foobar', ' ', '*^!%@$+' ),
  44. 'test_value' => "Coordinator", ), );
  45. }
  46. public function getPKColumnList()
  47. {
  48. return array( 'STAFF_ID', 'PAPER_CODE', 'YEAR_TAUGHT' );
  49. }
  50. public function getFKColumnList()
  51. {
  52. return array(
  53. 'STAFF' => array( 'STAFF_ID' ),
  54. 'PAPER' => array( 'PAPER_CODE' ),
  55. );
  56. }
  57. public function getUniqueColumnList()
  58. {
  59. return array();
  60. }
  61. }
  62. ?>