Newer
Older
sqlmarker / UsedCars / Test_classes / Service / UsedCars_Test_Service.php
  1. <?php
  2. require_once "Schema.php";
  3.  
  4. abstract class UsedCars_Test_Service extends PHPUnit_Extensions_Database_TestCase_CreateTable
  5. {
  6. public function getTableName()
  7. {
  8. return 'SERVICE';
  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', 'SMALLINT' ),
  16. 'min_length' => 4,
  17. 'max_length' => 4,
  18. 'decimals' => 0,
  19. 'nullable' => false,
  20. 'test_value' => '4571', ), // Has to be an unused Person_ID in the fixture because of the FK.
  21. 'HOURLY_RATE' => array( 'generic_type' => 'NUMBER',
  22. 'sql_type' => array( 'NUMBER', 'DECIMAL' ),
  23. 'min_length' => 5,
  24. 'max_length' => 5,
  25. 'decimals' => 2,
  26. 'nullable' => false,
  27. 'underflow' => 13.49,
  28. 'overflow' => 1000,
  29. 'legal_values' => array( 13.50, 20, 135.95, 999.99 ),
  30. 'test_value' => '25.50', ),
  31. 'TOTAL_HOURS' => array( 'generic_type' => 'NUMBER',
  32. 'sql_type' => array( 'NUMBER', 'DECIMAL' ),
  33. 'min_length' => 6,
  34. 'max_length' => 6,
  35. 'decimals' => 2,
  36. 'nullable' => false,
  37. 'default' => 0,
  38. 'underflow' => -0.01,
  39. 'overflow' => 4500.01,
  40. 'legal_values' => array( 0, 10.25, 100.5, 1000.75, 4500 ),
  41. 'illegal_values'=> array( 10.24, 100.55, 1000.76, 48.64 ),
  42. 'test_value' => '500.5', ),
  43. );
  44. }
  45. public function getPKColumnList()
  46. {
  47. return array( 'STAFF_ID' );
  48. }
  49. public function getFKColumnList()
  50. {
  51. return array(
  52. 'STAFF' => array( 'STAFF_ID' ),
  53. );
  54. }
  55. public function getUniqueColumnList()
  56. {
  57. return array();
  58. }
  59. }
  60. ?>