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
Added legal boundary values for Salary.
master
1 parent
2ecb0c7
commit
2675b1a1de272c6c5b36446c1312bc3221dbbdf1
Nigel Stanger
authored
on 4 Sep 2013
Patch
Showing
1 changed file
STINK_student_records/Test_classes/Staff/STINK_student_records_Test_Staff.php
Ignore Space
Show notes
View
STINK_student_records/Test_classes/Staff/STINK_student_records_Test_Staff.php
<?php require_once "Schema.php"; abstract class STINK_student_records_Test_Staff extends PHPUnit_Extensions_Database_TestCase_CreateTable { public function getTableName() { return 'STAFF'; } 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' => 7, 'max_length' => 7, 'decimals' => 0, 'nullable' => false, 'test_value' => "1234569", ), // Has to be an unused Person_ID in the fixture because of the FK. 'RANK' => array( 'generic_type' => 'TEXT', 'sql_type' => array( 'CHAR', 'VARCHAR2', 'VARCHAR' ), 'min_length' => 2, 'nullable' => false, 'legal_values' => array( 'T', 'AL', 'L', 'SL', 'AP', 'P', ), 'illegal_values'=> array( 't', '12', ' ', ), 'test_value' => "SL", ), 'SALARY' => array( 'generic_type' => 'NUMBER', 'sql_type' => array( 'NUMBER', 'DECIMAL' ), 'min_length' => 8, 'decimals' => 2, 'underflow' => 40449.99, 'legal_values' => array( 40450 ), 'nullable' => false, 'test_value' => "100000", ), ); } public function getPKColumnList() { return array( 'STAFF_ID' ); } public function getFKColumnList() { return array( 'PERSON' => array( 'STAFF_ID' ) ); } } ?>
<?php require_once "Schema.php"; abstract class STINK_student_records_Test_Staff extends PHPUnit_Extensions_Database_TestCase_CreateTable { public function getTableName() { return 'STAFF'; } 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' => 7, 'max_length' => 7, 'decimals' => 0, 'nullable' => false, 'test_value' => "1234569", ), // Has to be an unused Person_ID in the fixture because of the FK. 'RANK' => array( 'generic_type' => 'TEXT', 'sql_type' => array( 'CHAR', 'VARCHAR2', 'VARCHAR' ), 'min_length' => 2, 'nullable' => false, 'legal_values' => array( 'T', 'AL', 'L', 'SL', 'AP', 'P', ), 'illegal_values'=> array( 't', '12', ' ', ), 'test_value' => "SL", ), 'SALARY' => array( 'generic_type' => 'NUMBER', 'sql_type' => array( 'NUMBER', 'DECIMAL' ), 'min_length' => 8, 'decimals' => 2, 'underflow' => 40449.99, 'nullable' => false, 'test_value' => "100000", ), ); } public function getPKColumnList() { return array( 'STAFF_ID' ); } public function getFKColumnList() { return array( 'PERSON' => array( 'STAFF_ID' ) ); } } ?>
Show line notes below