PHP 클래스 Elgg\TestCase

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

공개 프로퍼티들

프로퍼티 타입 설명
$_instance TestCase
$_mocks Elgg\Mocks\Di\MockServiceProvider

공개 메소드들

메소드 설명
__construct ( string $name = NULL, array $data = [], string $dataName = '' ) Constructs a test case with the given name.
bootstrap ( ) : void Bootstraps test suite
config ( Config $config = null ) : Config Get/set Config for testing purposes
getInstance ( ) : TestCase Returns current test instance
getTestingConfigArray ( ) : array Returns default testing configuration array
mocks ( ) : Elgg\TestCaseMocks Retuns mocking utility library
prepareHttpRequest ( string $uri = '', string $method = 'GET', array $parameters = [], integer $ajax, boolean $add_csrf_tokens = false ) : Request Create an HTTP request
setupMockServices ( boolean $reset = true ) : void Substitute database dependent services with their doubles

메소드 상세

__construct() 공개 메소드

Bootstraps testing environment
public __construct ( string $name = NULL, array $data = [], string $dataName = '' )
$name string
$data array
$dataName string

bootstrap() 공개 정적인 메소드

Bootstraps test suite
public static bootstrap ( ) : void
리턴 void

config() 공개 정적인 메소드

Get/set Config for testing purposes
public static config ( Config $config = null ) : Config
$config Config Config
리턴 Config

getInstance() 공개 정적인 메소드

Returns current test instance
public static getInstance ( ) : TestCase
리턴 TestCase

getTestingConfigArray() 공개 정적인 메소드

Returns default testing configuration array
public static getTestingConfigArray ( ) : array
리턴 array

mocks() 공개 정적인 메소드

Retuns mocking utility library
public static mocks ( ) : Elgg\TestCaseMocks
리턴 Elgg\TestCaseMocks

prepareHttpRequest() 공개 정적인 메소드

Create an HTTP request
public static prepareHttpRequest ( string $uri = '', string $method = 'GET', array $parameters = [], integer $ajax, boolean $add_csrf_tokens = false ) : Request
$uri string URI of the request
$method string HTTP method
$parameters array Query/Post parameters
$ajax integer AJAX api version (0 for non-ajax)
$add_csrf_tokens boolean Add CSRF tokens
리턴 Elgg\Http\Request

setupMockServices() 공개 정적인 메소드

Substitute database dependent services with their doubles
public static setupMockServices ( boolean $reset = true ) : void
$reset boolean Reset service provider
리턴 void

프로퍼티 상세

$_instance 정적으로 공개적으로 프로퍼티

static public TestCase,elgg $_instance
리턴 TestCase

$_mocks 정적으로 공개적으로 프로퍼티

static public MockServiceProvider,Elgg\Mocks\Di $_mocks
리턴 Elgg\Mocks\Di\MockServiceProvider