PHP Класс eZ\Publish\Core\Persistence\Legacy\Tests\TestCase

Наследование: extends PHPUnit_Framework_TestCas\PHPUnit_Framework_TestCase
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$connection Doctrine\DBAL\Connection Doctrine Database connection -- to not be constructed twice for one test.
$db string Name of the DB, extracted from DSN.
$dsn string DSN used for the DB backend.
$handler eZ\Publish\Core\Persistence\Database\DatabaseHandler Database handler -- to not be constructed twice for one test.
$initial Property which holds the state if this is the initial test run, so that we should set up the database, or if this is any of the following test runs, where it is sufficient to reset the database.

Открытые методы

Метод Описание
assertQueryResult ( array $expectation, eZ\Publish\Core\Persistence\Database\SelectQuery $query, string $message = null ) Assert query result as correct.
getDatabaseConnection ( ) : Doctrine\DBAL\Connection Get native Doctrine database connection.
getDatabaseHandler ( ) : ConnectionHandler Get a eZ Doctrine database connection handler.
resetSequences ( ) Reset DB sequences.
setUp ( ) Resets the database on test setup, so we always operate on a clean database.

Защищенные методы

Метод Описание
assertPropertiesCorrect ( array $properties, object $object ) Asserts correct property values on $object.
assertStructsEqual ( object $expStruct, object $actStruct, array $propertyNames = null ) Asserts $expStruct equals $actStruct in at least $propertyNames.
getDsn ( ) : string Get data source name.
getInstallationDir ( ) : string
getPublicPropertyNames ( object $object ) : array Returns public property names in $object.
getResultTextRepresentation ( array $result ) : string Get a text representation of a result set.
insertDatabaseFixture ( string $file ) Inserts database fixture from $file.
tearDown ( )

Описание методов

assertPropertiesCorrect() защищенный Метод

Asserts that for all keys in $properties a corresponding property exists in $object with the *same* value as in $properties.
protected assertPropertiesCorrect ( array $properties, object $object )
$properties array
$object object

assertQueryResult() публичный статический Метод

Builds text representations of the asserted and fetched query result, based on a eZ\Publish\Core\Persistence\Database\SelectQuery object. Compares them using classic diff for maximum readability of the differences between expectations and real results. The expectation MUST be passed as a two dimensional array containing rows of columns.
public static assertQueryResult ( array $expectation, eZ\Publish\Core\Persistence\Database\SelectQuery $query, string $message = null )
$expectation array
$query eZ\Publish\Core\Persistence\Database\SelectQuery
$message string

assertStructsEqual() защищенный Метод

Asserts that properties of $actStruct equal properties of $expStruct (not vice versa!). If $propertyNames is null, all properties are checked. Otherwise, $propertyNames provides a white list.
protected assertStructsEqual ( object $expStruct, object $actStruct, array $propertyNames = null )
$expStruct object
$actStruct object
$propertyNames array

getDatabaseConnection() публичный Метод

Get native Doctrine database connection.
public getDatabaseConnection ( ) : Doctrine\DBAL\Connection
Результат Doctrine\DBAL\Connection

getDatabaseHandler() публичный Метод

Get a ConnectionHandler, which can be used to interact with the configured database. The database connection string is read from an optional environment variable "DATABASE" and defaults to an in-memory SQLite database.
public getDatabaseHandler ( ) : ConnectionHandler
Результат eZ\Publish\Core\Persistence\Doctrine\ConnectionHandler

getDsn() защищенный Метод

The database connection string is read from an optional environment variable "DATABASE" and defaults to an in-memory SQLite database.
protected getDsn ( ) : string
Результат string

getInstallationDir() защищенный статический Метод

protected static getInstallationDir ( ) : string
Результат string

getPublicPropertyNames() защищенный Метод

Returns public property names in $object.
protected getPublicPropertyNames ( object $object ) : array
$object object
Результат array

getResultTextRepresentation() защищенный статический Метод

Get a text representation of a result set.
protected static getResultTextRepresentation ( array $result ) : string
$result array
Результат string

insertDatabaseFixture() защищенный Метод

Inserts database fixture from $file.
protected insertDatabaseFixture ( string $file )
$file string

resetSequences() публичный Метод

Reset DB sequences.
public resetSequences ( )

setUp() публичный Метод

Resets the database on test setup, so we always operate on a clean database.
public setUp ( )

tearDown() защищенный Метод

protected tearDown ( )

Описание свойств

$connection защищенное свойство

Doctrine Database connection -- to not be constructed twice for one test.
protected Connection,Doctrine\DBAL $connection
Результат Doctrine\DBAL\Connection

$db защищенное свойство

Name of the DB, extracted from DSN.
protected string $db
Результат string

$dsn защищенное свойство

DSN used for the DB backend.
protected string $dsn
Результат string

$handler защищенное свойство

Database handler -- to not be constructed twice for one test.
protected DatabaseHandler,eZ\Publish\Core\Persistence\Database $handler
Результат eZ\Publish\Core\Persistence\Database\DatabaseHandler

$initial защищенное статическое свойство

Property which holds the state if this is the initial test run, so that we should set up the database, or if this is any of the following test runs, where it is sufficient to reset the database.
protected static $initial