Newer
Older
sqlmarker / UsedCars / Test_classes / Other / UsedCars_Test_Other.php
  1. <?php
  2. require_once "Schema.php";
  3.  
  4. abstract class STINK_student_records_Test_Student extends PHPUnit_Extensions_Database_TestCase_CreateTable
  5. {
  6. public function getTableName()
  7. {
  8. return 'STUDENT';
  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. 'STUDENT_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' => "1234571", ), // Has to be an unused Person_ID in the fixture because of the FK.
  21. 'HOME_PHONE' => array( 'generic_type' => 'TEXT',
  22. 'sql_type' => array( 'VARCHAR2', 'VARCHAR' ),
  23. 'min_length' => 15,
  24. 'nullable' => true,
  25. 'test_value' => "612245678764", ),
  26. 'HOME_ADDRESS' => array( 'generic_type' => 'TEXT',
  27. 'sql_type' => array( 'VARCHAR2', 'VARCHAR' ),
  28. 'min_length' => 200,
  29. 'max_length' => 200,
  30. 'nullable' => false,
  31. 'test_value' => "30 Pinewood Ave, Kalumba, NSW", ),
  32. 'INTERNATIONAL' => array( 'generic_type' => 'TEXT',
  33. 'sql_type' => array( 'CHAR', 'VARCHAR2', 'VARCHAR' ),
  34. 'min_length' => 1,
  35. 'nullable' => false,
  36. 'default' => FALSE_VALUE,
  37. 'legal_values' => array( TRUE_VALUE, FALSE_VALUE ),
  38. // 'f', 'F', 'false', 'False', 'FALSE', 'n', 'N', 'no', 'No', 'NO', '0',
  39. // 't', 'T', 'true', 'True', 'TRUE', 'y', 'Y', 'yes', 'Yes', 'YES', '1', ),
  40. 'illegal_values'=> array( ' ', 'X', '9', '@' ),
  41. 'test_value' => TRUE_VALUE, ),
  42. // No need to test legal values because of the FK. If the FK is missing it's broken anyway!
  43. 'SUPERVISOR_ID' => array( 'generic_type' => 'NUMBER',
  44. 'sql_type' => array( 'NUMBER', 'INTEGER' ),
  45. 'aliases' => array( 'STAFF_ID', 'PERSON_ID' ),
  46. 'min_length' => 7,
  47. 'max_length' => 7,
  48. 'nullable' => true,
  49. 'test_value' => "1234567", ), );
  50. }
  51. public function getPKColumnList()
  52. {
  53. return array( 'STUDENT_ID' );
  54. }
  55. public function getFKColumnList()
  56. {
  57. return array(
  58. 'PERSON' => array( 'STUDENT_ID' ),
  59. 'STAFF' => array( 'SUPERVISOR_ID' ),
  60. );
  61. }
  62. public function getUniqueColumnList()
  63. {
  64. return array();
  65. }
  66. }
  67. ?>