PHP Class SQLBuilder\Testing\PDOQueryTestCase

Author: Yo-An Lin ([email protected])
Inheritance: extends SQLBuilder\Testing\QueryTestCase
Mostra file Open project: c9s/sqlbuilder Class Usage Examples

Public Properties

Property Type Description
$driverType
$dsn database connection string (DSN)
$fixture Fixture files
$fixtureDir Fixture directory path
$options PDO connection options
$pass database password
$pdo PDO connection handle
$schema Schema files
$schemaDir Schema directory path
$user database username

Public Methods

Method Description
assertDriverQuery ( BaseDriver $driver, SQLBuilder\ToSqlInterface $query )
assertQuery ( SQLBuilder\ToSqlInterface $query, $message = null )
createConnection ( $driverType )
getConnection ( )
getCurrentDSN ( )
getCurrentDriverType ( )
getCurrentPass ( )
getCurrentUser ( )
getDb ( )
getDriverDSN ( $driverType )
getDriverPass ( $driverType )
getDriverUser ( $driverType )
getOptions ( )
query ( $sql, array $args = [] ) * public function assertSqlQueries(ToSqlInterface $query, array $defines) { foreach($defines as $define) { list($driver, $expectedSQL) = $define; $args = new ArgumentArray; $sql = $query->toSql($driver, $args); $this->assertEquals($expectedSQL, $sql); $this->assertDriverQuery($driver, $query); } }
queryOk ( string $sql, array $args = [], $message = null ) Test Query
schema ( )
setUp ( )
setupFixture ( )
setupSchema ( )
testConnection ( )

Protected Methods

Method Description
assertNoPDOError ( PDO $conn, $message = null )
executeOk ( $sql, $args )
recordOk ( $sql )

Method Details

assertDriverQuery() public method

public assertDriverQuery ( BaseDriver $driver, SQLBuilder\ToSqlInterface $query )
$driver SQLBuilder\Driver\BaseDriver
$query SQLBuilder\ToSqlInterface

assertNoPDOError() protected method

protected assertNoPDOError ( PDO $conn, $message = null )
$conn PDO

assertQuery() public method

public assertQuery ( SQLBuilder\ToSqlInterface $query, $message = null )
$query SQLBuilder\ToSqlInterface

createConnection() public method

public createConnection ( $driverType )

executeOk() protected method

protected executeOk ( $sql, $args )

getConnection() public method

public getConnection ( )

getCurrentDSN() public method

public getCurrentDSN ( )

getCurrentDriverType() public method

getCurrentPass() public method

public getCurrentPass ( )

getCurrentUser() public method

public getCurrentUser ( )

getDb() public method

public getDb ( )

getDriverDSN() public method

public getDriverDSN ( $driverType )

getDriverPass() public method

public getDriverPass ( $driverType )

getDriverUser() public method

public getDriverUser ( $driverType )

getOptions() public method

public getOptions ( )

query() public method

* public function assertSqlQueries(ToSqlInterface $query, array $defines) { foreach($defines as $define) { list($driver, $expectedSQL) = $define; $args = new ArgumentArray; $sql = $query->toSql($driver, $args); $this->assertEquals($expectedSQL, $sql); $this->assertDriverQuery($driver, $query); } }
public query ( $sql, array $args = [] )
$args array

queryOk() public method

Test Query
public queryOk ( string $sql, array $args = [], $message = null )
$sql string SQL statement.
$args array Arguments for executing SQL statement.

recordOk() protected method

protected recordOk ( $sql )

schema() public method

public schema ( )

setUp() public method

public setUp ( )

setupFixture() public method

public setupFixture ( )

setupSchema() public method

public setupSchema ( )

testConnection() public method

public testConnection ( )

Property Details

$driverType public_oe property

public $driverType

$dsn public_oe property

database connection string (DSN)
public $dsn

$fixture public_oe property

Fixture files
public $fixture

$fixtureDir public_oe property

Fixture directory path
public $fixtureDir

$options public_oe property

PDO connection options
public $options

$pass public_oe property

database password
public $pass

$pdo public_oe property

PDO connection handle
public $pdo

$schema public_oe property

Schema files
public $schema

$schemaDir public_oe property

Schema directory path
public $schemaDir

$user public_oe property

database username
public $user