PHP Класс phpbb_functional_test_case

Наследование: extends phpbb_test_case
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$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