TestDatabase

Extends PHPUnit_Extensions_Database_TestCase

Abstract test case class for database testing.

abstract deprecated
since

1.0

deprecated

2.0 Deprecated due to the deprecation of phpunit/dbunit

package

Joomla Framework

Methods

assignMockCallbacks

Assigns mock callbacks to methods.

assignMockCallbacks(\PHPUnit_Framework_MockObject_MockObject mockObject, array array) : void
deprecated
note

This method assumes that the mock callback is named {mock}{method name}.

since

1.0

deprecated

2.0 Use TestHelper::assignMockCallbacks instead

Arguments

mockObject

\PHPUnit_Framework_MockObject_MockObjectThe mock object that the callbacks are being assigned to.

array

arrayAn array of methods names to mock with callbacks.

assignMockReturns

Assigns mock values to methods.

assignMockReturns(\PHPUnit_Framework_MockObject_MockObject mockObject, array array) : void
deprecated
since

1.0

deprecated

2.0 Use TestHelper::assignMockReturns instead

Arguments

mockObject

\PHPUnit_Framework_MockObject_MockObjectThe mock object.

array

arrayAn associative array of methods to mock with return values: string (method name) => mixed (return value)

getConnection

Returns the default database connection for running the tests.

getConnection() : \PHPUnit_Extensions_Database_DB_IDatabaseConnection
deprecated
since

1.0

deprecated

2.0

Response

\PHPUnit_Extensions_Database_DB_IDatabaseConnection

getDataSet

Gets the data set to be loaded into the database during setup

getDataSet() : \PHPUnit_Extensions_Database_DataSet_IDataSet
deprecated
since

1.0

deprecated

2.0

Response

\PHPUnit_Extensions_Database_DataSet_IDataSet

getSetUpOperation

Returns the database operation executed in test setup.

getSetUpOperation() : \PHPUnit_Extensions_Database_Operation_IDatabaseOperation
deprecated
since

1.0

deprecated

2.0

Response

\PHPUnit_Extensions_Database_Operation_IDatabaseOperation

getTearDownOperation

Returns the database operation executed in test cleanup.

getTearDownOperation() : \PHPUnit_Extensions_Database_Operation_IDatabaseOperation
deprecated
since

1.0

deprecated

2.0

Response

\PHPUnit_Extensions_Database_Operation_IDatabaseOperation

setUp

Sets up the fixture.

setUp() : void
deprecated

This method is called before a test is executed.

since

1.0

deprecated

2.0

setUpBeforeClass

This method is called before the first test of this test class is run.

setUpBeforeClass() : void
static deprecated
since

1.0

deprecated

2.0

tearDownAfterClass

This method is called after the last test of this test class is run.

tearDownAfterClass() : void
static deprecated
since

1.0

deprecated

2.0

Properties

driver

The active database driver being used for the tests.

static deprecated
since

1.0

deprecated

2.0

Type(s)

\Joomla\Database\DatabaseDriver