GitBucket
4.21.2
Toggle navigation
Snippets
Sign in
Files
Branches
1
Releases
Issues
Pull requests
Labels
Priorities
Milestones
Wiki
Forks
nigel.stanger
/
sqlmarker
Browse code
• Adjusted minimum precision of salary and dropped maximum precision.
master
1 parent
41a573a
commit
69945b894575341c265208d31279288ce91afb0c
Nigel Stanger
authored
on 8 Apr 2014
Patch
Showing
1 changed file
UsedCars/Test_classes/Other/UsedCars_Test_Other.php
Ignore Space
Show notes
View
UsedCars/Test_classes/Other/UsedCars_Test_Other.php
<?php require_once "Schema.php"; abstract class UsedCars_Test_Other extends PHPUnit_Extensions_Database_TestCase_CreateTable { public function getTableName() { return 'OTHER'; } public function getColumnList() { return array( // No need to test legal values because of the FK. If the FK is missing it's broken anyway! 'STAFF_ID' => array( 'generic_type' => 'NUMBER', 'sql_type' => array( 'NUMBER', 'INTEGER' ), 'min_length' => 4, 'max_length' => 4, 'decimals' => 0, 'nullable' => false, 'aliases' => array( 'OTHER_ID', 'OTHER_STAFF_ID' ), 'test_value' => '4571', ), // Has to be an unused Person_ID in the fixture because of the FK. 'SALARY' => array( 'generic_type' => 'NUMBER', 'sql_type' => array( 'NUMBER', 'DECIMAL' ), 'min_length' => 7, 'decimals' => 2, 'nullable' => false, 'underflow' => 28079.99, 'legal_values' => array( 28080, 999999.99 ), 'illegal_values'=> array( -10, 10000 ), 'test_value' => '45000', ), ); } public function getPKColumnList() { return array( 'STAFF_ID' ); } public function getFKColumnList() { return array( 'STAFF' => array( 'STAFF_ID' ), ); } public function getUniqueColumnList() { return array(); } } ?>
<?php require_once "Schema.php"; abstract class UsedCars_Test_Other extends PHPUnit_Extensions_Database_TestCase_CreateTable { public function getTableName() { return 'OTHER'; } public function getColumnList() { return array( // No need to test legal values because of the FK. If the FK is missing it's broken anyway! 'STAFF_ID' => array( 'generic_type' => 'NUMBER', 'sql_type' => array( 'NUMBER', 'INTEGER' ), 'min_length' => 4, 'max_length' => 4, 'decimals' => 0, 'nullable' => false, 'aliases' => array( 'OTHER_ID', 'OTHER_STAFF_ID' ), 'test_value' => '4571', ), // Has to be an unused Person_ID in the fixture because of the FK. 'SALARY' => array( 'generic_type' => 'NUMBER', 'sql_type' => array( 'NUMBER', 'DECIMAL' ), 'min_length' => 8, 'max_length' => 8, 'decimals' => 2, 'nullable' => false, 'underflow' => 28079.99, 'legal_values' => array( 28080, 999999.99 ), 'illegal_values'=> array( -10, 10000 ), 'test_value' => '45000', ), ); } public function getPKColumnList() { return array( 'STAFF_ID' ); } public function getFKColumnList() { return array( 'STAFF' => array( 'STAFF_ID' ), ); } public function getUniqueColumnList() { return array(); } } ?>
Show line notes below