| core_db

# Class: Bs_Mysql_PhpUnit Source Location: /core/db/ecg/Bs_MySql_PhpUnit.class.php
### Class Overview
    Bs_Assert
       |
       --Bs_TestCase
          |
          --Bs_Mysql_PhpUnit
#### Author(s): andrej arn <at blueshoes dot org> #### Version: 4.3.$Revision: 1.2 $ $Date: 2003/08/09 15:17:48 $ | ### Variables $_APP $_Bs_MySql $_dsn $_field $_res | ### Methods Bs_MySql_PhpUnit runTest setUp __Bs_MySql_affectedRows __Bs_MySql_affectedRows2 __Bs_MySql_connect __Bs_MySql_connect2 __Bs_MySql_databaseExists __Bs_MySql_databaseName __Bs_MySql_disconnect __Bs_MySql_disconnect2 __Bs_MySql_fetchDatabaseNames __Bs_MySql_fetchField __Bs_MySql_fetchField2 __Bs_MySql_fetchField3 __Bs_MySql_fetchFieldNames __Bs_MySql_fetchFieldNames2 __Bs_MySql_fetchRow __Bs_MySql_fetchTableNames __Bs_MySql_fieldExists __Bs_MySql_fieldFlags __Bs_MySql_fieldFlags2 __Bs_MySql_fieldFlags3 __Bs_MySql_fieldLen __Bs_MySql_fieldName __Bs_MySql_fieldName2 __Bs_MySql_fieldName3 __Bs_MySql_fieldName4 __Bs_MySql_fieldType __Bs_MySql_getDbStructure __Bs_MySql_getIniVar __Bs_MySql_getOpenTables __Bs_MySql_getStatusVar __Bs_MySql_getTableInfo __Bs_MySql_getTableProperties __Bs_MySql_hasFieldFlag __Bs_MySql_hasFieldFlag2 __Bs_MySql_hasFieldFlag3 __Bs_MySql_insertId __Bs_MySql_isReservedWord __Bs_MySql_listDatabases __Bs_MySql_listFields __Bs_MySql_listTables __Bs_MySql_numCols __Bs_MySql_numCols2 __Bs_MySql_numRows __Bs_MySql_numRows2 __Bs_MySql_read __Bs_MySql_selectDb __Bs_MySql_selectDb2 __Bs_MySql_subSelect __Bs_MySql_tableExists __Bs_MySql_tableName __Bs_MySql_tableName2
### Inherited Variables #### Class: Bs_TestCase Bs_TestCase::$_fExceptions Bs_TestCase::$_fName Bs_TestCase::$_fResult | ### Inherited Methods #### Class: Bs_TestCase Bs_TestCase::Bs_TestCase() Bs_TestCase::countTestCases() Bs_TestCase::error() Bs_TestCase::fail() Bs_TestCase::failed() Bs_TestCase::getExceptions() Bs_TestCase::name() Bs_TestCase::run() Run a single TestCase in the context of this TestResult Bs_TestCase::runBare() Bs_TestCase::runTest() Bs_TestCase::setUp() Bs_TestCase::tearDown() Bs_TestCase::_createResult()
### Class Details [line 11] #### Tags:
version: | 4.3.$Revision: 1.2 $ $Date: 2003/08/09 15:17:48 $
author: | andrej arn <at blueshoes dot org>
[ Top ] ### Class Variables #### $_APP = [line 14]
Type: | mixed
[ Top ] #### $_Bs_MySql = [line 13]
Type: | mixed
[ Top ] #### $_dsn = [line 15]
Type: | mixed
[ Top ] #### $_field = [line 17]
Type: | mixed
[ Top ] #### $_res = [line 16]
Type: | mixed
[ Top ] ### Class Methods ### method Bs_MySql_PhpUnit [line 20]
`void Bs_MySql_PhpUnit( mixed $name)`
[ Top ] ### method runTest [line 78]
`void runTest( )`
Overrides Bs_TestCase::runTest() (parent method not documented) [ Top ] ### method setUp [line 26]
`void setUp( )`
Overrides Bs_TestCase::setUp() (parent method not documented) [ Top ] ### method __Bs_MySql_affectedRows [line 262]
`void __Bs_MySql_affectedRows( )`
this update matches 1 record, but mysql doesn't need to update the table, so we really expect 0. rtfm if you don't believe it. [ Top ] ### method __Bs_MySql_affectedRows2 [line 273]
`void __Bs_MySql_affectedRows2( )`
this update matches 2 records, but mysql should only need to update one. [ Top ] ### method __Bs_MySql_connect [line 144]
`void __Bs_MySql_connect( )`
test to open a nonpersistent connection. [ Top ] ### method __Bs_MySql_connect2 [line 164]
`void __Bs_MySql_connect2( )`
test to open a persistent connection. [ Top ] ### method __Bs_MySql_databaseExists [line 711]
`void __Bs_MySql_databaseExists( )`
[ Top ] ### method __Bs_MySql_databaseName [line 376]
`void __Bs_MySql_databaseName( )`
this test is a bit buggy. we cannot know which databases will exist on the server, so we cannot know which one will be at which position. so we check for a string as return value. but while testing i got things back like '0' and '1' and '2' which were accepted as valid strings, when i expected to get an error... well. [ Top ] ### method __Bs_MySql_disconnect [line 154]
`void __Bs_MySql_disconnect( )`
close the previously opened non-p connection [ Top ] ### method __Bs_MySql_disconnect2 [line 174]
`void __Bs_MySql_disconnect2( )`
try to close the prev. opened p-connection, which is expected to fail and thus return false. [ Top ] ### method __Bs_MySql_fetchDatabaseNames [line 676]
`void __Bs_MySql_fetchDatabaseNames( )`
[ Top ] ### method __Bs_MySql_fetchField [line 542]
`void __Bs_MySql_fetchField( )`
there is no such field '100' [ Top ] ### method __Bs_MySql_fetchField2 [line 551]
`void __Bs_MySql_fetchField2( )`
[ Top ] ### method __Bs_MySql_fetchField3 [line 560]
`void __Bs_MySql_fetchField3( )`
let's check all values of our tinyint field. [ Top ] ### method __Bs_MySql_fetchFieldNames [line 643]
`void __Bs_MySql_fetchFieldNames( )`
[ Top ] ### method __Bs_MySql_fetchFieldNames2 [line 652]
`void __Bs_MySql_fetchFieldNames2( )`
[ Top ] ### method __Bs_MySql_fetchRow [line 215]
`void __Bs_MySql_fetchRow( )`
[ Top ] ### method __Bs_MySql_fetchTableNames [line 662]
`void __Bs_MySql_fetchTableNames( )`
[ Top ] ### method __Bs_MySql_fieldExists [line 691]
`void __Bs_MySql_fieldExists( )`
[ Top ] ### method __Bs_MySql_fieldFlags [line 391]
`void __Bs_MySql_fieldFlags( )`
[ Top ] ### method __Bs_MySql_fieldFlags2 [line 397]
`void __Bs_MySql_fieldFlags2( )`
[ Top ] ### method __Bs_MySql_fieldFlags3 [line 403]
`void __Bs_MySql_fieldFlags3( )`
[ Top ] ### method __Bs_MySql_fieldLen [line 384]
`void __Bs_MySql_fieldLen( )`
[ Top ] ### method __Bs_MySql_fieldName [line 298]
`void __Bs_MySql_fieldName( )`
no such field and invalid resource. [ Top ] ### method __Bs_MySql_fieldName2 [line 307]
`void __Bs_MySql_fieldName2( )`
should work... [ Top ] ### method __Bs_MySql_fieldName3 [line 316]
`void __Bs_MySql_fieldName3( )`
there are not 15 fields, only 4. [ Top ] ### method __Bs_MySql_fieldName4 [line 336]
`void __Bs_MySql_fieldName4( )`
this gets a bit more complicated. in dos mysql, it looks like this: mysql> select test.iD, field1 as field2, field2 as shit from test; +----+------------+--------+ | iD | field2 | shit | +----+------------+--------+ | 1 | hello | world | | 2 | foo | bar | | 3 | test | record | | 4 | new record | | +----+------------+--------+ 4 rows in set (0.00 sec) [ Top ] ### method __Bs_MySql_fieldType [line 453]
`void __Bs_MySql_fieldType( )`
mysql_field_type() returns strange field types. and even 'unknown' for some. so if mysql changes this behavior, we want to know it... [ Top ] ### method __Bs_MySql_getDbStructure [line 763]
`void __Bs_MySql_getDbStructure( )`
[ Top ] ### method __Bs_MySql_getIniVar [line 720]
`void __Bs_MySql_getIniVar( )`
[ Top ] ### method __Bs_MySql_getOpenTables [line 738]
`void __Bs_MySql_getOpenTables( )`
[ Top ] ### method __Bs_MySql_getStatusVar [line 729]
`void __Bs_MySql_getStatusVar( )`
[ Top ] ### method __Bs_MySql_getTableInfo [line 805]
`void __Bs_MySql_getTableInfo( )`
[ Top ] ### method __Bs_MySql_getTableProperties [line 796]
`void __Bs_MySql_getTableProperties( )`
[ Top ] ### method __Bs_MySql_hasFieldFlag [line 424]
`void __Bs_MySql_hasFieldFlag( )`
of course there's no such flag 'lalalala'. [ Top ] ### method __Bs_MySql_hasFieldFlag2 [line 433]
`void __Bs_MySql_hasFieldFlag2( )`
[ Top ] ### method __Bs_MySql_hasFieldFlag3 [line 442]
`void __Bs_MySql_hasFieldFlag3( )`
[ Top ] ### method __Bs_MySql_insertId [line 284]
`void __Bs_MySql_insertId( )`
[ Top ] ### method __Bs_MySql_isReservedWord [line 814]
`void __Bs_MySql_isReservedWord( )`
[ Top ] ### method __Bs_MySql_listDatabases [line 633]
`void __Bs_MySql_listDatabases( )`
[ Top ] ### method __Bs_MySql_listFields [line 613]
`void __Bs_MySql_listFields( )`
[ Top ] ### method __Bs_MySql_listTables [line 623]
`void __Bs_MySql_listTables( )`
[ Top ] ### method __Bs_MySql_numCols [line 225]
`void __Bs_MySql_numCols( )`
[ Top ] ### method __Bs_MySql_numCols2 [line 233]
`void __Bs_MySql_numCols2( )`
[ Top ] ### method __Bs_MySql_numRows [line 243]
`void __Bs_MySql_numRows( )`
[ Top ] ### method __Bs_MySql_numRows2 [line 251]
`void __Bs_MySql_numRows2( )`
[ Top ] ### method __Bs_MySql_read [line 205]
`void __Bs_MySql_read( )`
i know that this is not mysql related. but we need a resourse for the tests below, so why not... [ Top ] ### method __Bs_MySql_selectDb [line 184]
`void __Bs_MySql_selectDb( )`
this db has been created before so it should exist. [ Top ] ### method __Bs_MySql_selectDb2 [line 194]
`void __Bs_MySql_selectDb2( )`
this db should not exist. [ Top ] ### method __Bs_MySql_subSelect [line 831]
`void __Bs_MySql_subSelect( )`
test to open a persistent connection. [ Top ] ### method __Bs_MySql_tableExists [line 702]
`void __Bs_MySql_tableExists( )`
also windows should return true for this table, even if the table in real is called 'allfieldtypes' (lower case). [ Top ] ### method __Bs_MySql_tableName [line 349]
`void __Bs_MySql_tableName( )`
[ Top ] ### method __Bs_MySql_tableName2 [line 361]
`void __Bs_MySql_tableName2( )`
i hope no-one added something in there that adds another test table with a name that comes above/before 'allfieldtypes' !!! otherwise this test fails. [ Top ] Documentation generated on Mon, 29 Dec 2003 21:12:03 +0100 by phpDocumentor 1.2.3