Newer
Older
sqlmarker / UsedCars / Test_classes / Warranty / UsedCars_Test_Warranty.php
  1. <?php
  2. require_once "Schema.php";
  3.  
  4. abstract class STINK_student_records_Test_Enrolment extends PHPUnit_Extensions_Database_TestCase_CreateTable
  5. {
  6. public function getTableName()
  7. {
  8. return 'ENROLMENT';
  9. }
  10. public function getColumnList()
  11. {
  12. return array(
  13. 'ENROLMENT_ID' => array( 'generic_type' => 'NUMBER',
  14. 'sql_type' => array( 'NUMBER', 'INTEGER' ),
  15. 'min_length' => 10,
  16. 'max_length' => 10,
  17. 'decimals' => 0,
  18. 'nullable' => false,
  19. 'test_value' => "8765432109", ),
  20. 'DESCRIPTION' => array( 'generic_type' => 'TEXT',
  21. 'sql_type' => array( 'VARCHAR2', 'VARCHAR' ),
  22. 'min_length' => 100,
  23. 'max_length' => 100,
  24. 'nullable' => false,
  25. 'test_value' => "Blah blah blah", ),
  26. 'YEAR_ENROLLED' => array( 'generic_type' => 'NUMBER',
  27. 'sql_type' => array( 'NUMBER', 'INTEGER' ),
  28. 'min_length' => 4,
  29. 'max_length' => 4,
  30. 'nullable' => false,
  31. 'underflow' => 1981,
  32. 'legal_values' => array( 1982 ),
  33. 'test_value' => "2013", ),
  34. 'COMMENTS' => array( 'generic_type' => 'TEXT',
  35. 'sql_type' => array( 'VARCHAR2', 'CLOB' ),
  36. 'min_length' => 500,
  37. 'nullable' => true,
  38. 'test_value' => "Blah blah blah", ),
  39. // No need to test legal values because of the FK. If the FK is missing it's broken anyway!
  40. 'STUDENT_ID' => array( 'generic_type' => 'NUMBER',
  41. 'sql_type' => array( 'NUMBER', 'INTEGER' ),
  42. 'min_length' => 7,
  43. 'max_length' => 7,
  44. 'decimals' => 0,
  45. 'nullable' => false,
  46. 'test_value' => "1234568", ), // Has to be an unused Person_ID in the fixture because of the FK.
  47. // No need to test legal values because of the FK. If the FK is missing it's broken anyway!
  48. 'PAPER_CODE' => array( 'generic_type' => 'TEXT',
  49. 'sql_type' => array( 'CHAR', 'VARCHAR2', 'VARCHAR' ),
  50. 'min_length' => 7,
  51. 'max_length' => 7,
  52. 'nullable' => false,
  53. 'test_value' => "ACCT112", ), );
  54. }
  55. public function getPKColumnList()
  56. {
  57. return array( 'ENROLMENT_ID' );
  58. }
  59. public function getFKColumnList()
  60. {
  61. return array(
  62. 'STUDENT' => array( 'STUDENT_ID' ),
  63. 'PAPER' => array( 'PAPER_CODE' ),
  64. );
  65. }
  66. public function getUniqueColumnList()
  67. {
  68. return array();
  69. }
  70. }
  71. ?>