Newer
Older
sqlmarker / Unit_testing / BDL_Test_Staff.php
<?php
require_once "Schema.php";

abstract class BDL_Test_Staff extends PHPUnit_Extensions_Database_TestCase_CreateTable
{
	public function getTableName()
	{
		return 'STAFF';
	}
	
	
	public function getColumnList()
	{
		return array(
			'STAFF_ID'		=>	array(	'type'			=>	array( 'NUMBER', 'INTEGER' ),
										'min_length'	=>	7,
										'max_length'	=>	7,
										'decimals'		=>	0,
// 										'underflow'		=>	-1,
										'nullable'		=>	false,
										'test_value'	=>	"123456",	),
			'SURNAME'		=>	array(	'type'			=>	array( 'VARCHAR2', 'VARCHAR' ),
										'min_length'	=>	50,
										'max_length'	=>	50,
										'nullable'		=>	false,
										'test_value'	=>	"'Bloggs'",	),
			'FIRSTNAMES'	=>	array(	'type'			=>	array( 'VARCHAR2', 'VARCHAR' ),
										'min_length'	=>	50,
										'max_length'	=>	50,
										'nullable'		=>	false,
										'test_value'	=>	"'Harold'",	),
			'PHONE'			=>	array(	'type'			=>	array( 'VARCHAR2', 'CHAR', 'VARCHAR' ),
										'min_length'	=>	11,
										'max_length'	=>	25,
										'nullable'		=>	false,
										'test_value'	=>	"'16139981234'",	),
			'ADDRESS'		=>	array(	'type'			=>	array( 'VARCHAR2', 'VARCHAR' ),
										'min_length'	=>	150,
										'max_length'	=>	150,
										'nullable'		=>	false,
										'test_value'	=>	"'12 Western Way'",	),
			'DEPARTMENT'	=>	array(	'type'			=>	array( 'VARCHAR2', 'VARCHAR' ),
										'min_length'	=>	18,
										'max_length'	=>	20,
										'nullable'		=>	false,
										'legal_values'	=> array(
											"'Central Management'", "'Sales ' || chr(38) || ' Marketing'",
											"'Personnel'", "'Manufacturing'", "'Inventory'", "'Accounts'"	),
										'illegal_values' => array(	"'foobar'", "'blurk'", "'   '"	),
										'test_value'	=>	"'Accounts'",	),
			'POSITION'		=>	array(	'type'			=>	array( 'VARCHAR2', 'VARCHAR' ),
										'min_length'	=>	20,
										'max_length'	=>	20,
										'nullable'		=>	false,
										'legal_values'	=> array(
											"'CEO'", "'CTO'", "'CFO'", "'CIO'", "'Director'", "'President'",
											"'Vice-President'", "'Manager'", "'Personal Assistant'",
											"'Secretary'", "'Technician'", "'Researcher'", "'Designer'",
											"'Assembler'", "'Programmer'", "'Contractor'",
											"'Sales Representative'", "'Accountant'", "'Inventory'",
											"'Assistant'"	),
										'illegal_values' => array(	"'foobar'", "'blurk'", "'   '"	),
										'test_value'	=>	"'CEO'",	),
			'SALARY'		=>	array(	'type'			=>	array( 'NUMBER', 'DECIMAL' ),
										'min_length'	=>	7,
										'max_length'	=>	7,
										'decimals'		=>	2,
										'underflow'		=>	999.99,
										'overflow'		=>	100000.00,
										'nullable'		=>	false,
										'test_value'	=>	"50000.00",	),
			'COMMENTS'		=>	array(	'type'			=>	array( 'VARCHAR2', 'CLOB' ),
										'min_length'	=>	1000,
										'max_length'	=>	4000,
										'nullable'		=>	true,
										'test_value'	=>	"'Blah blah blah'",	),	);
	}
	
	
	public function getPKColumnList()
	{
		return array( 'STAFF_ID' );
	}
	
	
	public function getFKColumnList()
	{
		return array();
	}
}
?>