phpDocumentor MySQL
UnitTests
[ class tree: MySQL ] [ index: MySQL ] [ all elements ]

Class: Mysql_Test

Source Location: /unitTests/mysql_test.php

Class Mysql_Test

Class Overview

Unit tests for Mysql class

Located in /unitTests/mysql_test.php [line 37]

UnitTestCase
   |
   --Mysql_Test
Author(s): Information Tags:
Link:  http://albertfama.com/pkgs/distro/mysql/mysql.zip
Since:  File available since release .01 Alpha
Version:  1.0 (Stable)
License:  GNU GPL
Copyright:  2009 Albert Fama

Properties

Methods

[ Top ]
Property Summary
Mysql   $_db   Mysql object

[ Top ]
Method Summary
void   testEscapeString()   Unit test of Mysql::escapeString() function.
void   testExecute()   Unit test of Mysql::execute() function.
void   testPrepare()   Unit test of Mysql::prepare() function.
void   testSelectDB()   Unit test of Mysql::selectDb() function.
void   _createInvalidObject()   Create invalid Mysql object without a default db
void   _createInvalidWithDB()   Create invalid Mysql object with a default db
void   _createValidObject()   Create valid Mysql object without a default db and store in member var
void   _createValidWithDB()   Create valid Mysql object with a default db and store in member var

[ Top ]
Properties
Mysql   $_db [line 44]

Mysql object

API Tags:
Access:  protected


[ Top ]
Methods
testEscapeString  [line 139]

  void testEscapeString( )

Unit test of Mysql::escapeString() function.

Method creates a valid Mysql object, sends a string to Mysql::escapeString() and checks that the string returned has been escaped. Then an invalid Mysql object is created and method checks that a Mysql_Exception is raised.


API Tags:
Access:  public
Uses:  Mysql_Test::_createInvalidObject()
Uses:  Mysql_Test::_createValidObject()


[ Top ]
testExecute  [line 185]

  void testExecute( )

Unit test of Mysql::execute() function.

Method creates a valid Mysql object with a default db, sends a valid query and checks that it receives a Mysql_Result object. Then an invalid statement is sent and checks that a Mysql_Exception is raised.


API Tags:
Access:  public
Uses:  Mysql_Test::_createValidWithDB()


[ Top ]
testPrepare  [line 228]

  void testPrepare( )

Unit test of Mysql::prepare() function.

Method creates a valid Mysql object with a default db, and check that it receives a Mysql_Statement object. Then an invalid Mysql object with a default db is created and checks that a Mysql_Exception is raised.


API Tags:
Access:  public
Uses:  Mysql_Test::_createInvalidWithDB()
Uses:  Mysql_Test::_createValidWithDB()


[ Top ]
testSelectDB  [line 101]

  void testSelectDB( )

Unit test of Mysql::selectDb() function.

Method creates a valid Mysql object without a default db, then attempts select a valid db and an invalid db.


API Tags:
Access:  public
Uses:  Mysql_Test::_createValidObject()


[ Top ]
_createInvalidObject  [line 64]

  void _createInvalidObject( )

Create invalid Mysql object without a default db

This method uses the invalid password so access should be denied. Invalid connection stored in member var.


API Tags:
Access:  protected

Information Tags:
Usedby:  Mysql_Test::testEscapeString()

[ Top ]
_createInvalidWithDB  [line 87]

  void _createInvalidWithDB( )

Create invalid Mysql object with a default db

This method uses the invalid db name so selecting the db should cause an error. Invalid connection stored in member var.


API Tags:
Access:  protected

Information Tags:
Usedby:  Mysql_Test::testPrepare()

[ Top ]
_createValidObject  [line 51]

  void _createValidObject( )

Create valid Mysql object without a default db and store in member var


API Tags:
Access:  protected

Information Tags:
Usedby:  Mysql_Statement_Test::testExecute()
Usedby:  Mysql_Test::testEscapeString()
Usedby:  Mysql_Test::testSelectDB()

[ Top ]
_createValidWithDB  [line 74]

  void _createValidWithDB( )

Create valid Mysql object with a default db and store in member var


API Tags:
Access:  protected

Information Tags:
Usedby:  Mysql_Test::testPrepare()
Usedby:  Mysql_Test::testExecute()

[ Top ]

Documentation generated on Mon, 15 Jun 2009 16:50:05 -0600 by phpDocumentor 1.3.0RC3