\JDatabaseQueryTest
Test class for JDatabaseQuery.
Synopsis
class JDatabaseQueryTest
extends TestCase
{
- // members
- protected JDatabaseDriver $dbo;
- private JDatabaseQuery $_instance;
- // Inherited members from TestCase
- protected $expectedErrors;
- // methods
- public array seedNullDateTest()
- public array seedQuoteTest()
- public void test__call()
- public void test__get()
- public void test__toStringFrom_subquery()
- public void test__toStringInsert_subquery()
- public void test__toStringYear()
- public void test__toStringMonth()
- public void test__toStringDay()
- public void test__toStringHour()
- public void test__toStringMinute()
- public void test__toStringSecond()
- public void test__toStringSelect()
- public void test__toStringUpdate()
- public void test__toStringUnion()
- public void test__toStringUnionAll()
- public void testCall()
- public void testCall__toString()
- public void testCastAsChar()
- public void testCharLength()
- public void testClear_all()
- public void testClear_clause()
- public void testClear_type()
- public void testColumns()
- public void testConcatenate()
- public void testCurrentTimestamp()
- public void testDateFormat()
- public void testDateFormatException()
- public void testDelete()
- public void testDelete__toString()
- public void testDump()
- public void testEscape()
- public void testEscapeException()
- public void testExec()
- public void testExec__toString()
- public void testFrom()
- public void testGroup()
- public void testHaving()
- public void testInnerJoin()
- public void testInsert()
- public void testJoin()
- public void testLeftJoin()
- public void testLength()
- public void testNullDate()
- public void testNullDateException()
- public void testOrder()
- public void testOuterJoin()
- public void testQuote()
- public void testQuoteException()
- public void testQuoteName()
- public void testQuoteNameException()
- public void testRightJoin()
- public void testSelect()
- public void testSet()
- public void testSetQuery()
- public void testSetQuery__toString()
- public void testUpdate()
- public void testValues()
- public void testWhere()
- public void test__clone_array()
- public void test__clone_object()
- public void testUnionChain()
- public void testUnionClear()
- public void testUnionUnion()
- public void testUnionDistinctString()
- public void testUnionDistinctTrue()
- public void testUnionDistinctFalse()
- public void testUnionArray()
- public void testUnionTwo()
- public void testUnionDistinct()
- public void testUnionDistinctArray()
- public void testFormat()
- protected void setUp()
- public array seedDateAdd()
- public void testDateAdd()
- public void testUnionAllUnion()
- public void testUnionAllArray()
- public void testUnionAllTwo()
- // Inherited methods from TestCase
- public static boolean errorCallback()
- public void assignMockCallbacks()
- public void assignMockReturns()
- public JException expectedErrorCallback()
- public JApplication getMockApplication()
- public JApplicationCms getMockCmsApp()
- public JConfig getMockConfig()
- public JDatabase getMockDatabase()
- public JEventDispatcher getMockDispatcher()
- public JDocument getMockDocument()
- public JLanguage getMockLanguage()
- public JSession getMockSession()
- public JApplicationWeb getMockWeb()
- public void setExpectedError()
- protected void restoreErrorHandlers()
- protected void restoreFactoryState()
- protected void saveErrorHandlers()
- protected void saveFactoryState()
- protected void setErrorHandlers()
- protected void setErrorCallback()
- protected void setUp()
- protected void tearDown()
Hierarchy
Extends
Members
private
- $_instance
—
JDatabaseQuery
The instance of the object to test.
protected
- $dbo — JDatabaseDriver
- $expectedErrors — array
Methods
protected
- setUp() — Sets up the fixture.
public
- seedDateAdd() — Data for the testDateAdd test.
- seedNullDateTest() — Data for the testNullDate test.
- seedQuoteTest() — Data for the testNullDate test.
- testCall() — Tests the JDatabaseQuery::call method.
- testCall__toString() — Tests the call property in method.
- testCastAsChar() — Test for the castAsChar method.
- testCharLength() — Test for the charLength method.
- testClear_all() — Test for the clear method (clearing all types and clauses).
- testClear_clause() — Test for the clear method (clearing each clause).
- testClear_type() — Test for the clear method (clearing each query type).
- testColumns() — Tests the JDatabaseQuery::columns method.
- testConcatenate() — Tests the JDatabaseQuery::concatenate method.
- testCurrentTimestamp() — Tests the JDatabaseQuery::currentTimestamp method.
- testDateAdd() — Tests the JDatabaseQuery::DateAdd method
- testDateFormat() — Tests the JDatabaseQuery::dateFormat method.
- testDateFormatException() — Tests the JDatabaseQuery::dateFormat method for an expected exception.
- testDelete() — Tests the JDatabaseQuery::delete method.
- testDelete__toString() — Tests the delete property in JDatabaseQuery::__toString method.
- testDump() — Tests the JDatabaseQuery::dump method.
- testEscape() — Tests the JDatabaseQuery::escape method.
- testEscapeException() — Tests the JDatabaseQuery::escape method for an expected exception.
- testExec() — Tests the JDatabaseQuery::exec method.
- testExec__toString() — Tests the exec property in JDatabaseQuery::__toString method.
- testFormat() — Tests the JDatabaseQuery::format method.
- testFrom() — Tests the JDatabaseQuery::from method.
- testGroup() — Tests the JDatabaseQuery::group method.
- testHaving() — Tests the JDatabaseQuery::having method.
- testInnerJoin() — Tests the JDatabaseQuery::innerJoin method.
- testInsert() — Tests the JDatabaseQuery::insert method.
- testJoin() — Tests the JDatabaseQuery::join method.
- testLeftJoin() — Tests the JDatabaseQuery::leftJoin method.
- testLength() — Tests the JDatabaseQuery::length method.
- testNullDate() — Tests the quoteName method.
- testNullDateException() — Tests the JDatabaseQuery::nullDate method for an expected exception.
- testOrder() — Tests the JDatabaseQuery::order method.
- testOuterJoin() — Tests the JDatabaseQuery::outerJoin method.
- testQuote() — Tests the quote method.
- testQuoteException() — Tests the JDatabaseQuery::nullDate method for an expected exception.
- testQuoteName() — Tests the quoteName method.
- testQuoteNameException() — Tests the JDatabaseQuery::quoteName method for an expected exception.
- testRightJoin() — Tests the JDatabaseQuery::rightJoin method.
- testSelect() — Tests the JDatabaseQuery::select method.
- testSet() — Tests the JDatabaseQuery::set method.
- testSetQuery() — Tests the JDatabaseQuery::setQuery method.
- testSetQuery__toString() — Tests rendering coupled with the JDatabaseQuery::setQuery method.
- testUnionAllArray() — Tests the JDatabaseQuery::unionAll method.
- testUnionAllTwo() — Tests the JDatabaseQuery::unionAll method.
- testUnionAllUnion() — Tests the JDatabaseQuery::unionAll method.
- testUnionArray() — Tests the JDatabaseQuery::union method.
- testUnionChain() — Tests the JDatabaseQuery::union method.
- testUnionClear() — Tests the JDatabaseQuery::union method.
- testUnionDistinct() — Tests the JDatabaseQuery::unionDistinct method.
- testUnionDistinctArray() — Tests the JDatabaseQuery::unionDistinct method.
- testUnionDistinctFalse() — Tests the JDatabaseQuery::union method.
- testUnionDistinctString() — Tests the JDatabaseQuery::union method.
- testUnionDistinctTrue() — Tests the JDatabaseQuery::union method.
- testUnionTwo() — Tests the JDatabaseQuery::union method.
- testUnionUnion() — Tests the JDatabaseQuery::union method.
- testUpdate() — Tests the JDatabaseQuery::update method.
- testValues() — Tests the JDatabaseQuery::values method.
- testWhere() — Tests the JDatabaseQuery::where method.
- test__call() — Test for the JDatabaseQuery::__call method.
- test__clone_array() — Tests the JDatabaseQuery::__clone method properly clones an array.
- test__clone_object() — Tests the JDatabaseQuery::__clone method properly clones an object.
- test__get() — Test for the JDatabaseQuery::__get method.
- test__toStringDay() — Test for day extraction from date.
- test__toStringFrom_subquery() — Test for FROM clause with subquery.
- test__toStringHour() — Test for hour extraction from date.
- test__toStringInsert_subquery() — Test for INSERT INTO clause with subquery.
- test__toStringMinute() — Test for minute extraction from date.
- test__toStringMonth() — Test for month extraction from date.
- test__toStringSecond() — Test for seconds extraction from date.
- test__toStringSelect() — Test for the JDatabaseQuery::__string method for a 'select' case.
- test__toStringUnion() — Tests the union element of __toString.
- test__toStringUnionAll() — Tests the unionAll element of __toString.
- test__toStringUpdate() — Test for the JDatabaseQuery::__string method for a 'update' case.
- test__toStringYear() — Test for year extraction from date.
Inherited from TestCase
protected
- restoreErrorHandlers() — Sets the JError error handlers.
- restoreFactoryState() — Sets the Factory pointers
- saveErrorHandlers() — Saves the current state of the JError error handlers.
- saveFactoryState() — Saves the Factory pointers
- setErrorCallback() — Sets the JError error handlers to callback mode and points them at the test logging method.
- setErrorHandlers() — Sets the JError error handlers.
- setUp() — Overrides the parent setup method.
- tearDown() — Overrides the parent tearDown method.
public
- assignMockCallbacks() — Assigns mock callbacks to methods.
- assignMockReturns() — Assigns mock values to methods.
- errorCallback() — Receives the callback from JError and logs the required error information for the test.
- expectedErrorCallback() — Callback receives the error from JError and deals with it appropriately If a test expects a JError to be raised, it should call this setExpectedError first If you don't call this method first, the test will fail.
- getMockApplication() — Gets a mock application object.
- getMockCmsApp() — Gets a mock CMS application object.
- getMockConfig() — Gets a mock configuration object.
- getMockDatabase() — Gets a mock database object.
- getMockDispatcher() — Gets a mock dispatcher object.
- getMockDocument() — Gets a mock document object.
- getMockLanguage() — Gets a mock language object.
- getMockSession() — Gets a mock session object.
- getMockWeb() — Gets a mock web object.
- setExpectedError() — Tells the unit tests that a method or action you are about to attempt is expected to result in JError::raiseSomething being called.