Newer
Older
sqlmarker / Unit_testing / BDL_Test_Component.php
  1. <?php
  2. require_once "Schema.php";
  3.  
  4. abstract class BDL_Test_Component extends PHPUnit_Extensions_Database_TestCase_CreateTable
  5. {
  6. public function getTableName()
  7. {
  8. return 'COMPONENT';
  9. }
  10. public function getColumnList()
  11. {
  12. return array(
  13. 'COMPONENT_CODE' => array( 'type' => array( 'NUMBER', 'INTEGER' ),
  14. 'min_length' => 8,
  15. 'max_length' => 8,
  16. 'decimals' => 0,
  17. // 'underflow' => -1,
  18. 'nullable' => false,
  19. 'test_value' => "87654321", ),
  20. 'SUPPLIERS_CODE' => array( 'type' => array( 'VARCHAR2', 'VARCHAR' ),
  21. 'min_length' => 25,
  22. 'max_length' => 25,
  23. 'nullable' => false,
  24. 'test_value' => "'B87654321'", ),
  25. 'DESCRIPTION' => array( 'type' => array( 'VARCHAR2', 'VARCHAR' ),
  26. 'min_length' => 100,
  27. 'max_length' => 100,
  28. 'nullable' => false,
  29. 'test_value' => "'Some component'", ),
  30. 'STOCK_COUNT' => array( 'type' => array( 'NUMBER', 'INTEGER' ),
  31. 'min_length' => 7,
  32. 'max_length' => 7,
  33. 'decimals' => 0,
  34. 'underflow' => -1,
  35. 'overflow' => 10000000,
  36. 'nullable' => false,
  37. 'test_value' => "456", ),
  38. 'SUPPLIER_ID' => array( 'type' => array( 'NUMBER', 'INTEGER' ),
  39. 'min_length' => 7,
  40. 'max_length' => 7,
  41. 'decimals' => 0,
  42. 'nullable' => false,
  43. 'test_value' => "1", ), );
  44. }
  45. public function getPKColumnList()
  46. {
  47. return array( 'COMPONENT_CODE', 'SUPPLIERS_CODE' );
  48. }
  49. public function getFKColumnList()
  50. {
  51. return array( 'SUPPLIER' => array ( 'SUPPLIER_ID' ) );
  52. }
  53. }
  54. ?>