PHP Class Sulu\Bundle\TestBundle\Testing\SuluTestCase

Inheritance: extends Symfony\Cmf\Bundle\RoutingBundle\Tests\Functional\BaseTestCase
Show file Open project: sulu/sulu Class Usage Examples

Protected Properties

Property Type Description
$importer PHPCRImporter

Public Methods

Method Description
setUpBeforeClass ( )
tearDown ( ) Close the database connection after the tests finish.

Protected Methods

Method Description
createAuthenticatedClient ( ) : Client Create an authenticated client.
createHomeDocument ( string $name, array $locales ) Create a webspace node with the given locales.
createWebsiteClient ( ) : Client Create client for tests on the "website" context.
getEntityManager ( )
getTestUser ( ) : TestUser Return the test user (which is provided / created by the test_user_provider in this Bundle at runtime).
getTestUserId ( ) : integer Return the ID of the test user (which is provided / created by the test_user_provider in this Bundle at runtime).
initPhpcr ( ) Initialize / reset the Sulu PHPCR environment.
purgeDatabase ( ) Purge the Doctrine ORM database.
setUp ( )

Method Details

createAuthenticatedClient() protected method

Create an authenticated client.
protected createAuthenticatedClient ( ) : Client
return Symfony\Bundle\FrameworkBundle\Client

createHomeDocument() protected method

Create a webspace node with the given locales.
protected createHomeDocument ( string $name, array $locales )
$name string
$locales array

createWebsiteClient() protected method

Create client for tests on the "website" context.
protected createWebsiteClient ( ) : Client
return Symfony\Bundle\FrameworkBundle\Client

getEntityManager() protected method

protected getEntityManager ( )

getTestUser() protected method

Return the test user (which is provided / created by the test_user_provider in this Bundle at runtime).

getTestUserId() protected method

Return the ID of the test user (which is provided / created by the test_user_provider in this Bundle at runtime).
protected getTestUserId ( ) : integer
return integer

initPhpcr() protected method

NOTE: We could use the document initializer here rather than manually creating the webspace nodes, but it currently adds more overhead and offers no control over *which* webspaces are created, see https://github.com/sulu-io/sulu/pull/2063 for a solution.
protected initPhpcr ( )

purgeDatabase() protected method

Purge the Doctrine ORM database.
protected purgeDatabase ( )

setUp() protected method

protected setUp ( )

setUpBeforeClass() public static method

public static setUpBeforeClass ( )

tearDown() public method

Close the database connection after the tests finish.
public tearDown ( )

Property Details

$importer protected property

protected PHPCRImporter,Sulu\Bundle\TestBundle\Testing $importer
return PHPCRImporter