Newer
Older
sqlmarker / UsedCars / Test_classes / Customer / UsedCars_Test_Customer.php
  1. <?php
  2. require_once "Schema.php";
  3.  
  4. abstract class UsedCars_Test_Customer extends PHPUnit_Extensions_Database_TestCase_CreateTable
  5. {
  6. public function getTableName()
  7. {
  8. return 'CUSTOMER';
  9. }
  10. public function getColumnList()
  11. {
  12. return array(
  13. 'CUSTOMER_ID' => array( 'generic_type' => 'NUMBER',
  14. 'sql_type' => array( 'NUMBER', 'INTEGER' ),
  15. 'min_length' => 6,
  16. 'max_length' => 6,
  17. 'decimals' => 0,
  18. 'nullable' => false,
  19. 'test_value' => '234550', ),
  20. 'FIRSTNAME' => array( 'generic_type' => 'TEXT',
  21. 'sql_type' => array( 'VARCHAR2', 'VARCHAR' ),
  22. 'min_length' => 50,
  23. 'max_length' => 50,
  24. 'nullable' => false,
  25. 'test_value' => 'Sarah', ),
  26. 'LASTNAME' => array( 'generic_type' => 'TEXT',
  27. 'sql_type' => array( 'VARCHAR2', 'VARCHAR' ),
  28. 'min_length' => 50,
  29. 'max_length' => 50,
  30. 'nullable' => false,
  31. 'test_value' => 'Smith', ),
  32. 'ADDRESS' => array( 'generic_type' => 'TEXT',
  33. 'sql_type' => array( 'VARCHAR2', 'VARCHAR' ),
  34. 'min_length' => 150,
  35. 'max_length' => 150,
  36. 'nullable' => false,
  37. 'test_value' => '123 George Street, Dunedin', ),
  38. 'PHONE' => array( 'generic_type' => 'TEXT',
  39. 'sql_type' => array( 'VARCHAR2', 'VARCHAR' ),
  40. 'min_length' => 11,
  41. 'nullable' => false,
  42. 'test_value' => '02144679437', ),
  43. 'EMAIL' => array( 'generic_type' => 'TEXT',
  44. 'sql_type' => array( 'VARCHAR2', 'VARCHAR' ),
  45. 'min_length' => 50,
  46. 'max_length' => 50,
  47. 'nullable' => true,
  48. 'legal_values' => array(
  49. 'email@example.com', 'EMAIL@EXAMPLE.COM', 'email@example.co.nz',
  50. 'test.email@some-place.co', 'email@thing.example.co.uk', 'email_address@example.com' ),
  51. 'illegal_values'=> array(
  52. '@example.com', 'email@', 'email@@example.com', 'email.com', 'email@com',
  53. 'email@example..com', 'email com' ),
  54. 'test_value' => 'test.email@example.com', ),
  55. 'CREDIT_RATING' => array( 'generic_type' => 'TEXT',
  56. 'sql_type' => array( 'CHAR', 'VARCHAR2', 'VARCHAR' ),
  57. 'min_length' => 1,
  58. 'max_length' => 1,
  59. 'nullable' => true,
  60. 'legal_values' => array( 'A', 'B', 'C', 'D' ),
  61. 'illegal_values'=> array( ' ', 'X', '9', '@', 'a', 'b', 'c', 'd' ),
  62. 'test_value' => 'A', ),
  63. 'COMMENTS' => array( 'generic_type' => 'TEXT',
  64. 'sql_type' => array( 'VARCHAR2', 'VARCHAR', 'CLOB' ),
  65. 'min_length' => 500,
  66. 'nullable' => true,
  67. 'test_value' => 'Blah blah blah', ),
  68. );
  69. }
  70. public function getPKColumnList()
  71. {
  72. return array( 'CUSTOMER_ID' );
  73. }
  74. public function getFKColumnList()
  75. {
  76. return array();
  77. }
  78. public function getUniqueColumnList()
  79. {
  80. return array();
  81. }
  82. }
  83. ?>