PHP 클래스 common\WebTestCase

상속: extends Symfony\Bundle\FrameworkBundle\Test\WebTestCase
파일 보기 프로젝트 열기: forkcms/forkcms 1 사용 예제들

보호된 메소드들

메소드 설명
assertIs404 ( Client $client )
backupParametersFile ( string $kernelDir ) Copies the parameters.yml file to a backup version
createClient ( array $options = [], array $server = [] ) : Client Creates a Client.
emptyTestDatabase ( SpoonDatabase $database ) Fully empties the test database
getKernelClass ( ) : string Attempts to guess the kernel location.
importSQL ( SpoonDatabase $database, string $sql ) Executes sql in the database
loadFixtures ( Client $client, array $fixtureClasses = [] )
login ( ) Logs in a user. We do this directly in the authentication class because this is a lot faster than submitting forms and following redirects
logout ( ) Log out a user
putParametersFileBack ( string $kernelDir ) Puts the backed up parameters.yml file back
requestWithGetParameters ( Client $client, string $url, array $data = [] ) : Crawler Do a request with the given GET parameters
setGetParameters ( array $data = [] ) Set the GET parameters, as some of the old code relies on GET
submitEditForm ( Client $client, Form $form, array $data = [] ) Edits the data of a form
submitForm ( Client $client, Form $form, array $data = [] ) Submits the form and mimics the GET parameters, since they aren't added by default in the functional tests
unsetGetParameters ( array $data = [] ) Unset the GET parameters, as some of the old code relies on GET

메소드 상세

assertIs404() 보호된 메소드

protected assertIs404 ( Client $client )
$client Symfony\Bundle\FrameworkBundle\Client

backupParametersFile() 보호된 메소드

Copies the parameters.yml file to a backup version
protected backupParametersFile ( string $kernelDir )
$kernelDir string

createClient() 보호된 정적인 메소드

Creates a Client.
protected static createClient ( array $options = [], array $server = [] ) : Client
$options array An array of options to pass to the createKernel class
$server array An array of server parameters
리턴 Symfony\Bundle\FrameworkBundle\Client A Client instance

emptyTestDatabase() 보호된 메소드

Fully empties the test database
protected emptyTestDatabase ( SpoonDatabase $database )
$database SpoonDatabase

getKernelClass() 보호된 정적인 메소드

When the Kernel is located, the file is required.
protected static getKernelClass ( ) : string
리턴 string The Kernel class name

importSQL() 보호된 메소드

Executes sql in the database
protected importSQL ( SpoonDatabase $database, string $sql )
$database SpoonDatabase
$sql string

loadFixtures() 보호된 메소드

protected loadFixtures ( Client $client, array $fixtureClasses = [] )
$client Symfony\Bundle\FrameworkBundle\Client
$fixtureClasses array

login() 보호된 메소드

Logging in using the forms is tested in the Authentication module
protected login ( )

logout() 보호된 메소드

Log out a user
protected logout ( )

putParametersFileBack() 보호된 메소드

Puts the backed up parameters.yml file back
protected putParametersFileBack ( string $kernelDir )
$kernelDir string

requestWithGetParameters() 보호된 메소드

Do a request with the given GET parameters
protected requestWithGetParameters ( Client $client, string $url, array $data = [] ) : Crawler
$client Symfony\Bundle\FrameworkBundle\Client
$url string
$data array
리턴 Symfony\Component\DomCrawler\Crawler

setGetParameters() 보호된 메소드

Set the GET parameters, as some of the old code relies on GET
protected setGetParameters ( array $data = [] )
$data array

submitEditForm() 보호된 메소드

Edits the data of a form
protected submitEditForm ( Client $client, Form $form, array $data = [] )
$client Symfony\Bundle\FrameworkBundle\Client
$form Symfony\Component\DomCrawler\Form
$data array

submitForm() 보호된 메소드

Submits the form and mimics the GET parameters, since they aren't added by default in the functional tests
protected submitForm ( Client $client, Form $form, array $data = [] )
$client Symfony\Bundle\FrameworkBundle\Client
$form Symfony\Component\DomCrawler\Form
$data array

unsetGetParameters() 보호된 메소드

Unset the GET parameters, as some of the old code relies on GET
protected unsetGetParameters ( array $data = [] )
$data array