Newer
Older
sqlmarker / Unit_testing / BDL_Test_Staff_data.php
  1. <?php
  2. require_once "BDL_Test_Staff.php";
  3.  
  4. /**
  5. * @backupGlobals disabled
  6. * @backupStaticAttributes disabled
  7. */
  8. class BDL_Test_Staff_data extends BDL_Test_Staff
  9. {
  10. /**
  11. * Return fixture data set for current database connection.
  12. *
  13. * @access protected
  14. * @return PHPUnit_Extensions_Database_DataSet_IDataSet
  15. * @todo Parameterise the fixture filename.
  16. */
  17. protected function getDataSet()
  18. {
  19. return $this->createXMLDataSet("BDL_Fixture_Staff.xml");
  20. }
  21. /**
  22. * @dataProvider provideColumnLegalValues
  23. */
  24. public function testColumnLegalValue( $columnName, $legalValue )
  25. {
  26. $this->assertColumnLegalValue( $columnName, $legalValue );
  27. }
  28. /**
  29. * @dataProvider provideColumnIllegalValues
  30. * @expectedException PDOException
  31. * @expectedExceptionMessage check constraint
  32. * @expectedExceptionCode HY000
  33. */
  34. public function testColumnIllegalValueExplicit( $columnName, $illegalValue )
  35. {
  36. $this->assertColumnIllegalValueExplicit( $columnName, $illegalValue );
  37. }
  38. /**
  39. * @dataProvider provideColumnIllegalValues
  40. * @expectedException PDOException
  41. * @expectedExceptionMessage length exceeded
  42. * @expectedExceptionCode HY000
  43. */
  44. public function testColumnIllegalValueImplicit( $columnName, $illegalValue )
  45. {
  46. $this->assertColumnIllegalValueImplicit( $columnName, $illegalValue );
  47. }
  48. /**
  49. * @dataProvider provideColumnUnderflowValues
  50. * @expectedException PDOException
  51. * @expectedExceptionMessage check constraint
  52. * @expectedExceptionCode HY000
  53. */
  54. public function testColumnUnderflowValue( $columnName, $underflowValue )
  55. {
  56. $this->assertColumnUnderflowValue( $columnName, $underflowValue );
  57. }
  58. /**
  59. * @dataProvider provideColumnOverflowValues
  60. * @expectedException PDOException
  61. * @expectedExceptionMessage check constraint
  62. * @expectedExceptionCode HY000
  63. */
  64. public function testColumnOverflowValueExplicit( $columnName, $overflowValue )
  65. {
  66. $this->assertColumnOverflowValueExplicit( $columnName, $overflowValue );
  67. }
  68. /**
  69. * @dataProvider provideColumnOverflowValues
  70. * @expectedException PDOException
  71. * @expectedExceptionMessage length exceeded
  72. * @expectedExceptionCode HY000
  73. */
  74. public function testColumnOverflowValueImplicit( $columnName, $overflowValue )
  75. {
  76. $this->assertColumnOverflowValueImplicit( $columnName, $overflowValue );
  77. }
  78. }
  79. ?>