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
Changed sample username to be the same as one in the fixture in order to show up any UNIQUE constraint.
master
1 parent
ef5311d
commit
0bfd951de57986da5c2145fb988cd03fb8c736ba
Nigel Stanger
authored
on 3 Sep 2013
Patch
Showing
1 changed file
STINK_student_records/Test_classes/Person/STINK_student_records_Test_Person.php
Ignore Space
Show notes
View
STINK_student_records/Test_classes/Person/STINK_student_records_Test_Person.php
<?php require_once "Schema.php"; abstract class STINK_student_records_Test_Person extends PHPUnit_Extensions_Database_TestCase_CreateTable { public function getTableName() { return 'PERSON'; } public function getColumnList() { return array( 'PERSON_ID' => array( 'generic_type' => 'NUMBER', 'sql_type' => array( 'NUMBER', 'INTEGER' ), 'min_length' => 7, 'max_length' => 7, 'decimals' => 0, 'nullable' => false, 'test_value' => "8765432", ), 'SURNAME' => array( 'generic_type' => 'TEXT', 'sql_type' => array( 'VARCHAR2', 'VARCHAR' ), 'min_length' => 50, 'max_length' => 50, 'nullable' => false, 'test_value' => "Smith", ), 'OTHER_NAMES' => array( 'generic_type' => 'TEXT', 'sql_type' => array( 'VARCHAR2', 'VARCHAR' ), 'min_length' => 50, 'max_length' => 50, 'nullable' => false, 'test_value' => "Sarah Jane", ), 'CONTACT_PHONE' => array( 'generic_type' => 'TEXT', 'sql_type' => array( 'VARCHAR2', 'VARCHAR' ), 'min_length' => 11, 'nullable' => true, 'test_value' => "02144679437", ), 'CONTACT_ADDRESS' => array( 'generic_type' => 'TEXT', 'sql_type' => array( 'VARCHAR2', 'VARCHAR' ), 'min_length' => 200, 'max_length' => 200, 'nullable' => false, 'test_value' => "123 George Street, Dunedin", ), 'EMAIL' => array( 'generic_type' => 'TEXT', 'sql_type' => array( 'VARCHAR2', 'VARCHAR' ), 'min_length' => 50, 'max_length' => 50, 'nullable' => false, 'legal_values' => array( 'email@example.com', 'EMAIL@EXAMPLE.COM', 'email@example.co.nz', 'test.email@some-place.co', 'email@thing.example.co.uk', 'email_address@example.com' ), 'illegal_values'=> array( '@example.com', 'email@', 'email@@example.com', 'email.com', 'email@com', 'email@example..com' ), 'test_value' => "test.email@example.com", ), 'USERNAME' => array( 'generic_type' => 'TEXT', 'sql_type' => array( 'VARCHAR2', 'VARCHAR' ), 'min_length' => 10, 'max_length' => 10, 'nullable' => false, 'legal_values' => array( 'username', 'a_username', 'username12', ), 'illegal_values'=> array( 'user name', '!@^%*&^!', ' ' ), 'test_value' => "dyssa123", ), ); } public function getPKColumnList() { return array( 'PERSON_ID' ); } public function getFKColumnList() { return array(); } } ?>
<?php require_once "Schema.php"; abstract class STINK_student_records_Test_Person extends PHPUnit_Extensions_Database_TestCase_CreateTable { public function getTableName() { return 'PERSON'; } public function getColumnList() { return array( 'PERSON_ID' => array( 'generic_type' => 'NUMBER', 'sql_type' => array( 'NUMBER', 'INTEGER' ), 'min_length' => 7, 'max_length' => 7, 'decimals' => 0, 'nullable' => false, 'test_value' => "8765432", ), 'SURNAME' => array( 'generic_type' => 'TEXT', 'sql_type' => array( 'VARCHAR2', 'VARCHAR' ), 'min_length' => 50, 'max_length' => 50, 'nullable' => false, 'test_value' => "Smith", ), 'OTHER_NAMES' => array( 'generic_type' => 'TEXT', 'sql_type' => array( 'VARCHAR2', 'VARCHAR' ), 'min_length' => 50, 'max_length' => 50, 'nullable' => false, 'test_value' => "Sarah Jane", ), 'CONTACT_PHONE' => array( 'generic_type' => 'TEXT', 'sql_type' => array( 'VARCHAR2', 'VARCHAR' ), 'min_length' => 11, 'nullable' => true, 'test_value' => "02144679437", ), 'CONTACT_ADDRESS' => array( 'generic_type' => 'TEXT', 'sql_type' => array( 'VARCHAR2', 'VARCHAR' ), 'min_length' => 200, 'max_length' => 200, 'nullable' => false, 'test_value' => "123 George Street, Dunedin", ), 'EMAIL' => array( 'generic_type' => 'TEXT', 'sql_type' => array( 'VARCHAR2', 'VARCHAR' ), 'min_length' => 50, 'max_length' => 50, 'nullable' => false, 'legal_values' => array( 'email@example.com', 'EMAIL@EXAMPLE.COM', 'email@example.co.nz', 'test.email@some-place.co', 'email@thing.example.co.uk', 'email_address@example.com' ), 'illegal_values'=> array( '@example.com', 'email@', 'email@@example.com', 'email.com', 'email@com', 'email@example..com' ), 'test_value' => "test.email@example.com", ), 'USERNAME' => array( 'generic_type' => 'TEXT', 'sql_type' => array( 'VARCHAR2', 'VARCHAR' ), 'min_length' => 10, 'max_length' => 10, 'nullable' => false, 'legal_values' => array( 'username', 'a_username', 'username12', ), 'illegal_values'=> array( 'user name', '!@^%*&^!', ' ' ), 'test_value' => "username", ), ); } public function getPKColumnList() { return array( 'PERSON_ID' ); } public function getFKColumnList() { return array(); } } ?>
Show line notes below