PHP 클래스 eZ\Publish\Core\Persistence\Legacy\Tests\TestCase

상속: extends PHPUnit_Framework_TestCas\PHPUnit_Framework_TestCase
파일 보기 프로젝트 열기: ezsystems/ezpublish-kernel 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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