PHP Class Contao\CoreBundle\Test\TestCase

Inheritance: extends PHPUnit_Framework_TestCase
Datei anzeigen Open project: contao/core-bundle Class Usage Examples

Public Methods

Method Description
getCacheDir ( ) : string Returns the path to the fixtures cache directory.
getRootDir ( ) : string Returns the path to the fixtures directory.
mockContaoFramework ( Symfony\Component\HttpFoundation\RequestStack $requestStack = null, Symfony\Component\Routing\RouterInterface $router = null, array $adapters = [], array $instances = [] ) : ContaoFramework Returns a ContaoFramework instance.

Protected Methods

Method Description
addImageServicesToContainer ( Symfony\Component\DependencyInjection\Container $container, string $rootDir = null ) Adds image services to the container.
mockConfigAdapter ( integer | null $minPasswordLength = null ) : Adapter | PHPUnit_Framework_MockObject_MockObject Mocks a config adapter.
mockContainerWithContaoScopes ( string | null $scope = null ) : PHPUnit_Framework_MockObject_MockObject | Symfony\Component\DependencyInjection\Container Mocks a container with scopes.
mockFilesModelAdapter ( ) : Adapter | PHPUnit_Framework_MockObject_MockObject Mocks a files model adapter.
mockKernel ( ) : Kernel | PHPUnit_Framework_MockObject_MockObject Mocks a Contao kernel.
mockRequestTokenAdapter ( ) : Adapter | PHPUnit_Framework_MockObject_MockObject Mocks a request token adapter.
mockRouter ( string $url ) : Symfony\Component\Routing\RouterInterface | PHPUnit_Framework_MockObject_MockObject Mocks a router returning the given URL.
mockSession ( ) : Symfony\Component\HttpFoundation\Session\SessionInterface Mocks a Symfony session containing the Contao attribute bags.
mockTokenManager ( ) : Symfony\Component\Security\Csrf\CsrfTokenManagerInterface | PHPUnit_Framework_MockObject_MockObject Mocks a CSRF token manager.

Method Details

addImageServicesToContainer() protected method

Adds image services to the container.
protected addImageServicesToContainer ( Symfony\Component\DependencyInjection\Container $container, string $rootDir = null )
$container Symfony\Component\DependencyInjection\Container
$rootDir string

getCacheDir() public method

Returns the path to the fixtures cache directory.
public getCacheDir ( ) : string
return string

getRootDir() public method

Returns the path to the fixtures directory.
public getRootDir ( ) : string
return string

mockConfigAdapter() protected method

Mocks a config adapter.
protected mockConfigAdapter ( integer | null $minPasswordLength = null ) : Adapter | PHPUnit_Framework_MockObject_MockObject
$minPasswordLength integer | null
return Contao\CoreBundle\Framework\Adapter | PHPUnit_Framework_MockObject_MockObject

mockContainerWithContaoScopes() protected method

Mocks a container with scopes.
protected mockContainerWithContaoScopes ( string | null $scope = null ) : PHPUnit_Framework_MockObject_MockObject | Symfony\Component\DependencyInjection\Container
$scope string | null
return PHPUnit_Framework_MockObject_MockObject | Symfony\Component\DependencyInjection\Container

mockContaoFramework() public method

Returns a ContaoFramework instance.
public mockContaoFramework ( Symfony\Component\HttpFoundation\RequestStack $requestStack = null, Symfony\Component\Routing\RouterInterface $router = null, array $adapters = [], array $instances = [] ) : ContaoFramework
$requestStack Symfony\Component\HttpFoundation\RequestStack
$router Symfony\Component\Routing\RouterInterface
$adapters array
$instances array
return Contao\CoreBundle\Framework\ContaoFramework The object instance

mockFilesModelAdapter() protected method

Mocks a files model adapter.
protected mockFilesModelAdapter ( ) : Adapter | PHPUnit_Framework_MockObject_MockObject
return Contao\CoreBundle\Framework\Adapter | PHPUnit_Framework_MockObject_MockObject

mockKernel() protected method

Mocks a Contao kernel.
protected mockKernel ( ) : Kernel | PHPUnit_Framework_MockObject_MockObject
return Symfony\Component\HttpKernel\Kernel | PHPUnit_Framework_MockObject_MockObject

mockRequestTokenAdapter() protected method

Mocks a request token adapter.
protected mockRequestTokenAdapter ( ) : Adapter | PHPUnit_Framework_MockObject_MockObject
return Contao\CoreBundle\Framework\Adapter | PHPUnit_Framework_MockObject_MockObject

mockRouter() protected method

Mocks a router returning the given URL.
protected mockRouter ( string $url ) : Symfony\Component\Routing\RouterInterface | PHPUnit_Framework_MockObject_MockObject
$url string
return Symfony\Component\Routing\RouterInterface | PHPUnit_Framework_MockObject_MockObject

mockSession() protected method

Mocks a Symfony session containing the Contao attribute bags.
protected mockSession ( ) : Symfony\Component\HttpFoundation\Session\SessionInterface
return Symfony\Component\HttpFoundation\Session\SessionInterface

mockTokenManager() protected method

Mocks a CSRF token manager.
protected mockTokenManager ( ) : Symfony\Component\Security\Csrf\CsrfTokenManagerInterface | PHPUnit_Framework_MockObject_MockObject
return Symfony\Component\Security\Csrf\CsrfTokenManagerInterface | PHPUnit_Framework_MockObject_MockObject