PHP 클래스 phpbb_functional_test_case

상속: extends phpbb_test_case
파일 보기 프로젝트 열기: phpbb/phpbb 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$already_installed
$cache
$client
$client Goutte\Client
$config
$cookieJar
$db
$extension_manager
$install_success
$lang array Language array used by phpBB
$last_post_timestamp
$root_url
$sid string Session ID for current test's session (each test makes its own)

공개 메소드들

메소드 설명
__construct ( $name = NULL, array $data = [], $dataName = '' )
assertContainsLang ( string $needle, string $haystack, string $message = null ) assertContains for language strings
assertNotContainsLang ( string $needle, string $haystack, string $message = null ) assertNotContains for language strings
assert_checkbox_is_checked ( Symfony\Component\DomCrawler\Crawler $crawler, string $name, string $message = '' ) : null Asserts that exactly one checkbox with name $name exists within the scope of $crawler and that the checkbox is checked.
assert_checkbox_is_unchecked ( Symfony\Component\DomCrawler\Crawler $crawler, string $name, string $message = '' ) : null Asserts that exactly one checkbox with name $name exists within the scope of $crawler and that the checkbox is unchecked.
assert_filter ( $crawler, $expr, $msg = null )
assert_find_one_checkbox ( Symfony\Component\DomCrawler\Crawler $crawler, string $name, string $message = '' ) : Symfony\Component\DomCrawler\Crawler Searches for an input element of type checkbox with the name $name using $crawler. Contains an assertion that only one such checkbox exists within the scope of $crawler.
assert_response_html ( $status_code = 200 ) * Perform some basic assertions for the page
assert_response_status_code ( integer $status_code = 200 ) : null Heuristic function to check that the response is success.
assert_response_xml ( $status_code = 200 ) * Perform some basic assertions for an xml page
create_post ( integer $forum_id, integer $topic_id, string $subject, string $message, array $additional_form_data = [], string $expected = '' ) : array | null Creates a post
create_private_message ( string $subject, string $message, array $to, array $additional_form_data = [] ) : integer Creates a private message
create_topic ( integer $forum_id, string $subject, string $message, array $additional_form_data = [], string $expected = '' ) : array | null Creates a topic
delete_post ( integer $forum_id, $post_id ) : null Deletes a post
delete_topic ( integer $topic_id ) : null Deletes a topic
get_content ( ) : string Get Client Content
get_parameter_from_link ( string $url, string $parameter ) : string Returns the requested parameter from a URL
get_passwords_manager ( ) : phpbb\passwords\manager Return a passwords manager instance
get_quickmod_page ( integer $topic_id, string $action, $crawler = false ) : Symfony\Component\DomCrawler\Crawler Get quickmod page
install_ext ( $extension )
request ( string $method, string $path, array $form_data = [], boolean $assert_response_html = true ) : Symfony\Component\DomCrawler\Crawler Perform a request to page
setUp ( )
setUpBeforeClass ( )
submit ( Symfony\Component\DomCrawler\Form $form, array $values = [], boolean $assert_response_html = true ) : Symfony\Component\DomCrawler\Crawler Submits a form

보호된 메소드들

메소드 설명
add_lang ( $lang_file )
add_lang_ext ( $ext_name, $lang_file )
add_style ( string $style_id, string $style_path, string $parent_style_id = 1, string $parent_style_path = 'prosilver' ) Creates a new style
add_user_group ( $group_name, $usernames, $default = false, $leader = false )
admin_login ( $username = 'admin' ) Login to the ACP You must run login() before calling this.
bootstrap ( ) test cases can override this
create_user ( string $username ) : integer Creates a new user with limited permissions
delete_style ( string $style_id, string $style_path ) Remove temporary style created by add_style()
get_cache_driver ( )
get_db ( )
get_extension_manager ( )
install_board ( )
lang ( )
login ( $username = 'admin' )
logout ( )
purge_cache ( )
remove_user_group ( $group_name, $usernames )
setup_extensions ( ) : array
submit_message ( string $posting_url, string $posting_contains, array $form_data ) : Crawler Helper for submitting a message (post or private message)
submit_post ( string $posting_url, string $posting_contains, array $form_data, string $expected = '' ) : array | null Helper for submitting posts
tearDown ( )

비공개 메소드들

메소드 설명
recreate_database ( $config )

메소드 상세

__construct() 공개 메소드

public __construct ( $name = NULL, array $data = [], $dataName = '' )
$data array

add_lang() 보호된 메소드

protected add_lang ( $lang_file )

add_lang_ext() 보호된 메소드

protected add_lang_ext ( $ext_name, $lang_file )

add_style() 보호된 메소드

Creates a new style
protected add_style ( string $style_id, string $style_path, string $parent_style_id = 1, string $parent_style_path = 'prosilver' )
$style_id string Style ID
$style_path string Style directory
$parent_style_id string Parent style id. Default = 1
$parent_style_path string Parent style directory. Default = 'prosilver'

add_user_group() 보호된 메소드

protected add_user_group ( $group_name, $usernames, $default = false, $leader = false )

admin_login() 보호된 메소드

Login to the ACP You must run login() before calling this.
protected admin_login ( $username = 'admin' )

assertContainsLang() 공개 메소드

assertContains for language strings
public assertContainsLang ( string $needle, string $haystack, string $message = null )
$needle string Search string
$haystack string Search this
$message string Optional failure message

assertNotContainsLang() 공개 메소드

assertNotContains for language strings
public assertNotContainsLang ( string $needle, string $haystack, string $message = null )
$needle string Search string
$haystack string Search this
$message string Optional failure message

assert_checkbox_is_checked() 공개 메소드

Asserts that exactly one checkbox with name $name exists within the scope of $crawler and that the checkbox is checked.
public assert_checkbox_is_checked ( Symfony\Component\DomCrawler\Crawler $crawler, string $name, string $message = '' ) : null
$crawler Symfony\Component\DomCrawler\Crawler
$name string
$message string
리턴 null

assert_checkbox_is_unchecked() 공개 메소드

Asserts that exactly one checkbox with name $name exists within the scope of $crawler and that the checkbox is unchecked.
public assert_checkbox_is_unchecked ( Symfony\Component\DomCrawler\Crawler $crawler, string $name, string $message = '' ) : null
$crawler Symfony\Component\DomCrawler\Crawler
$name string
$message string
리턴 null

assert_filter() 공개 메소드

public assert_filter ( $crawler, $expr, $msg = null )

assert_find_one_checkbox() 공개 메소드

Searches for an input element of type checkbox with the name $name using $crawler. Contains an assertion that only one such checkbox exists within the scope of $crawler.
public assert_find_one_checkbox ( Symfony\Component\DomCrawler\Crawler $crawler, string $name, string $message = '' ) : Symfony\Component\DomCrawler\Crawler
$crawler Symfony\Component\DomCrawler\Crawler
$name string
$message string
리턴 Symfony\Component\DomCrawler\Crawler

assert_response_html() 공개 정적인 메소드

Checks for debug/error output before the actual page content and the status code
public static assert_response_html ( $status_code = 200 )
$status_code Expected status code, false to disable check

assert_response_status_code() 공개 정적인 메소드

When php decides to die with a fatal error, it still sends 200 OK status code. This assertion tries to catch that.
public static assert_response_status_code ( integer $status_code = 200 ) : null
$status_code integer Expected status code
리턴 null

assert_response_xml() 공개 정적인 메소드

Checks for debug/error output before the actual page content and the status code
public static assert_response_xml ( $status_code = 200 )
$status_code Expected status code, false to disable check

bootstrap() 보호된 메소드

test cases can override this
protected bootstrap ( )

create_post() 공개 메소드

Be sure to login before creating
public create_post ( integer $forum_id, integer $topic_id, string $subject, string $message, array $additional_form_data = [], string $expected = '' ) : array | null
$forum_id integer
$topic_id integer
$subject string
$message string
$additional_form_data array Any additional form data to be sent in the request
$expected string Lang var of expected message after posting
리턴 array | null post_id, topic_id if message is empty

create_private_message() 공개 메소드

Be sure to login before creating
public create_private_message ( string $subject, string $message, array $to, array $additional_form_data = [] ) : integer
$subject string
$message string
$to array
$additional_form_data array Any additional form data to be sent in the request
리턴 integer private_message_id

create_topic() 공개 메소드

Be sure to login before creating
public create_topic ( integer $forum_id, string $subject, string $message, array $additional_form_data = [], string $expected = '' ) : array | null
$forum_id integer
$subject string
$message string
$additional_form_data array Any additional form data to be sent in the request
$expected string Lang var of expected message after posting
리턴 array | null post_id, topic_id if message is empty

create_user() 보호된 메소드

Creates a new user with limited permissions
protected create_user ( string $username ) : integer
$username string Also doubles up as the user's password
리턴 integer ID of created user

delete_post() 공개 메소드

Be sure to login before creating
public delete_post ( integer $forum_id, $post_id ) : null
$forum_id integer
리턴 null

delete_style() 보호된 메소드

Remove temporary style created by add_style()
protected delete_style ( string $style_id, string $style_path )
$style_id string Style ID
$style_path string Style directory

delete_topic() 공개 메소드

Be sure to login before creating
public delete_topic ( integer $topic_id ) : null
$topic_id integer
리턴 null

get_cache_driver() 보호된 메소드

protected get_cache_driver ( )

get_content() 공개 정적인 메소드

Get Client Content
public static get_content ( ) : string
리턴 string HTML page

get_db() 보호된 메소드

protected get_db ( )

get_extension_manager() 보호된 메소드

protected get_extension_manager ( )

get_passwords_manager() 공개 메소드

Return a passwords manager instance
public get_passwords_manager ( ) : phpbb\passwords\manager
리턴 phpbb\passwords\manager

get_quickmod_page() 공개 메소드

Get quickmod page
public get_quickmod_page ( integer $topic_id, string $action, $crawler = false ) : Symfony\Component\DomCrawler\Crawler
$topic_id integer
$action string Language key for the quickmod action
리턴 Symfony\Component\DomCrawler\Crawler

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

protected static install_board ( )

install_ext() 공개 메소드

public install_ext ( $extension )

lang() 보호된 메소드

protected lang ( )

login() 보호된 메소드

protected login ( $username = 'admin' )

logout() 보호된 메소드

protected logout ( )

purge_cache() 보호된 메소드

protected purge_cache ( )

remove_user_group() 보호된 메소드

protected remove_user_group ( $group_name, $usernames )

request() 공개 정적인 메소드

Perform a request to page
public static request ( string $method, string $path, array $form_data = [], boolean $assert_response_html = true ) : Symfony\Component\DomCrawler\Crawler
$method string HTTP Method
$path string Page path, relative from phpBB root path
$form_data array An array of form field values
$assert_response_html boolean Should we perform standard assertions for a normal html page
리턴 Symfony\Component\DomCrawler\Crawler

setUp() 공개 메소드

public setUp ( )

setUpBeforeClass() 공개 정적인 메소드

public static setUpBeforeClass ( )

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

protected static setup_extensions ( ) : array
리턴 array List of extensions that should be set up

submit() 공개 정적인 메소드

Submits a form
public static submit ( Symfony\Component\DomCrawler\Form $form, array $values = [], boolean $assert_response_html = true ) : Symfony\Component\DomCrawler\Crawler
$form Symfony\Component\DomCrawler\Form A Form instance
$values array An array of form field values
$assert_response_html boolean Should we perform standard assertions for a normal html page
리턴 Symfony\Component\DomCrawler\Crawler

submit_message() 보호된 메소드

Helper for submitting a message (post or private message)
protected submit_message ( string $posting_url, string $posting_contains, array $form_data ) : Crawler
$posting_url string
$posting_contains string
$form_data array
리턴 Symfony\Component\DomCrawler\Crawler the crawler object

submit_post() 보호된 메소드

Helper for submitting posts
protected submit_post ( string $posting_url, string $posting_contains, array $form_data, string $expected = '' ) : array | null
$posting_url string
$posting_contains string
$form_data array
$expected string Lang var of expected message after posting
리턴 array | null post_id, topic_id if message is empty

tearDown() 보호된 메소드

protected tearDown ( )

프로퍼티 상세

$already_installed 보호되어 있는 정적으로 프로퍼티

protected static $already_installed

$cache 보호되어 있는 프로퍼티

protected $cache

$client 보호되어 있는 정적으로 프로퍼티

protected static $client

$client 보호되어 있는 정적으로 프로퍼티

protected static Client,Goutte $client
리턴 Goutte\Client

$config 보호되어 있는 정적으로 프로퍼티

protected static $config

$cookieJar 보호되어 있는 정적으로 프로퍼티

protected static $cookieJar

$db 보호되어 있는 프로퍼티

protected $db

$extension_manager 보호되어 있는 프로퍼티

protected $extension_manager

$install_success 보호되어 있는 정적으로 프로퍼티

protected static $install_success

$lang 보호되어 있는 프로퍼티

Language array used by phpBB
protected array $lang
리턴 array

$last_post_timestamp 보호되어 있는 정적으로 프로퍼티

protected static $last_post_timestamp

$root_url 보호되어 있는 정적으로 프로퍼티

protected static $root_url

$sid 보호되어 있는 프로퍼티

Session ID for current test's session (each test makes its own)
protected string $sid
리턴 string