PHP Класс Codeception\Module\WPQueries

WordPress queries based assertions.
Наследование: extends Codeception\Module
Показать файл Открыть проект

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

Свойство Тип Описание
$assertions callable[]
$filteredQueries array
$wpdb wpdb

Открытые методы

Метод Описание
__construct ( Codeception\Lib\ModuleContainer $moduleContainer, null $config, tad\WPBrowser\Environment\Constants $constants = null, wpdb | null $wpdb = null ) WPQueries constructor.
_cleanup ( ) Runs before each test method.
_getFilteredQueriesIterator ( wpdb $wpdb = null ) : FilterIterator Returns the saved queries after filtering.
_initialize ( )
assertCountQueries ( integer $n, string $message = '' ) Asserts that n queries have been made.
assertNotQueries ( string $message = '' ) Asserts that no queries were made.
assertNotQueriesByAction ( string $action, string $message = '' ) Asserts that no queries were made as a consequence of the specified action.
assertNotQueriesByFilter ( string $filter, string $message = '' ) Asserts that no queries were made as a consequence of the specified filter.
assertNotQueriesByFunction ( string $function, string $message = '' ) Asserts that no queries were made by the specified function.
assertNotQueriesByMethod ( $class, $method, string $message = '' ) Asserts that no queries have been made by the specified class method.
assertNotQueriesByStatement ( string $statement, string $message = '' ) Asserts that no queries have been made by the specified class method.
assertNotQueriesByStatementAndAction ( string $statement, string $action, string $message = '' ) Asserts that no queries were made as a consequence of the specified action containing the specified SQL statement.
assertNotQueriesByStatementAndFilter ( string $statement, string $filter, string $message = '' ) Asserts that no queries were made as a consequence of the specified filter containing the specified SQL statement.
assertNotQueriesByStatementAndFunction ( string $statement, string $function, string $message = '' ) Asserts that no queries were made by the specified function starting with the specified SQL statement.
assertNotQueriesByStatementAndMethod ( string $statement, string $class, string $method, string $message = '' ) Asserts that no queries were made by the specified class method starting with the specified SQL statement.
assertQueries ( string $message = '' ) Asserts that at least one query was made during the test.
assertQueriesByAction ( string $action, string $message = '' ) Asserts that at least one query was made as a consequence of the specified action.
assertQueriesByFilter ( string $filter, string $message = '' ) Asserts that at least one query was made as a consequence of the specified filter.
assertQueriesByFunction ( string $function, string $message = '' ) Asserts that queries were made by the specified function.
assertQueriesByMethod ( string $class, string $method, string $message = '' ) Asserts that at least one query has been made by the specified class method.
assertQueriesByStatement ( string $statement, string $message = '' ) Asserts that at least a query starting with the specified statement was made.
assertQueriesByStatementAndAction ( string $statement, string $action, string $message = '' ) Asserts that at least one query was made as a consequence of the specified action containing the specified SQL statement.
assertQueriesByStatementAndFilter ( string $statement, string $filter, string $message = '' ) Asserts that at least one query was made as a consequence of the specified filter containing the specified SQL statement.
assertQueriesByStatementAndFunction ( string $statement, string $function, string $message = '' ) Asserts that queries were made by the specified function starting with the specified SQL statement.
assertQueriesByStatementAndMethod ( string $statement, string $class, string $method, string $message = '' ) Asserts that queries were made by the specified class method starting with the specified SQL statement.
assertQueriesCountByAction ( integer $n, string $action, string $message = '' ) Asserts that n queries were made as a consequence of the specified action.
assertQueriesCountByFilter ( integer $n, string $filter, string $message = '' ) Asserts that n queries were made as a consequence of the specified filter.
assertQueriesCountByFunction ( integer $n, string $function, string $message = '' ) Asserts that n queries were made by the specified function.
assertQueriesCountByMethod ( integer $n, string $class, string $method, string $message = '' ) Asserts that n queries have been made by the specified class method.
assertQueriesCountByStatement ( integer $n, string $statement, string $message = '' ) Asserts that n queries starting with the specified statement were made.
assertQueriesCountByStatementAndAction ( integer $n, string $statement, string $action, string $message = '' ) Asserts that n queries were made as a consequence of the specified action containing the specified SQL statement.
assertQueriesCountByStatementAndFilter ( integer $n, string $statement, string $filter, string $message = '' ) Asserts that n queries were made as a consequence of the specified filter containing the specified SQL statement.
assertQueriesCountByStatementAndFunction ( integer $n, string $statement, string $function, string $message = '' ) Asserts that n queries were made by the specified function starting with the specified SQL statement.
assertQueriesCountByStatementAndMethod ( integer $n, string $statement, string $class, string $method, string $message = '' ) Asserts that n queries were made by the specified class method starting with the specified SQL statement.

Приватные методы

Метод Описание
getWpdbInstance ( ) : wpdb
readQueries ( )

Описание методов

__construct() публичный Метод

WPQueries constructor.
public __construct ( Codeception\Lib\ModuleContainer $moduleContainer, null $config, tad\WPBrowser\Environment\Constants $constants = null, wpdb | null $wpdb = null )
$moduleContainer Codeception\Lib\ModuleContainer
$config null
$constants tad\WPBrowser\Environment\Constants
$wpdb wpdb | null

_cleanup() публичный Метод

Runs before each test method.
public _cleanup ( )

_getFilteredQueriesIterator() публичный Метод

Returns the saved queries after filtering.
public _getFilteredQueriesIterator ( wpdb $wpdb = null ) : FilterIterator
$wpdb wpdb
Результат FilterIterator

_initialize() публичный Метод

public _initialize ( )

assertCountQueries() публичный Метод

Asserts that n queries have been made.
public assertCountQueries ( integer $n, string $message = '' )
$n integer The expected number of queries.
$message string An optional message to override the default one.

assertNotQueries() публичный Метод

Queries generated by setUp, tearDown and factory methods are excluded by default.
public assertNotQueries ( string $message = '' )
$message string An optional message to override the default one.

assertNotQueriesByAction() публичный Метод

Queries generated by setUp, tearDown and factory methods are excluded by default.
public assertNotQueriesByAction ( string $action, string $message = '' )
$action string The action name, e.g. 'init'.
$message string An optional message to override the default one.

assertNotQueriesByFilter() публичный Метод

Queries generated by setUp, tearDown and factory methods are excluded by default.
public assertNotQueriesByFilter ( string $filter, string $message = '' )
$filter string The filter name, e.g. 'posts_where'.
$message string An optional message to override the default one.

assertNotQueriesByFunction() публичный Метод

Queries generated by setUp, tearDown and factory methods are excluded by default.
public assertNotQueriesByFunction ( string $function, string $message = '' )
$function string
$message string An optional message to override the default one.

assertNotQueriesByMethod() публичный Метод

Queries generated by setUp, tearDown and factory methods are excluded by default.
public assertNotQueriesByMethod ( $class, $method, string $message = '' )
$class
$method
$message string An optional message to override the default one.

assertNotQueriesByStatement() публичный Метод

Queries generated by setUp, tearDown and factory methods are excluded by default.
public assertNotQueriesByStatement ( string $statement, string $message = '' )
$statement string A simple string the statement should start with or a valid regular expression. Regular expressions must contain delimiters.
$message string An optional message to override the default one.

assertNotQueriesByStatementAndAction() публичный Метод

Queries generated by setUp, tearDown and factory methods are excluded by default.
public assertNotQueriesByStatementAndAction ( string $statement, string $action, string $message = '' )
$statement string A simple string the statement should start with or a valid regular expression. Regular expressions must contain delimiters.
$action string The action name, e.g. 'init'.
$message string An optional message to override the default one.

assertNotQueriesByStatementAndFilter() публичный Метод

Queries generated by setUp, tearDown and factory methods are excluded by default.
public assertNotQueriesByStatementAndFilter ( string $statement, string $filter, string $message = '' )
$statement string A simple string the statement should start with or a valid regular expression. Regular expressions must contain delimiters.
$filter string The filter name, e.g. 'posts_where'.
$message string An optional message to override the default one.

assertNotQueriesByStatementAndFunction() публичный Метод

Queries generated by setUp, tearDown and factory methods are excluded by default.
public assertNotQueriesByStatementAndFunction ( string $statement, string $function, string $message = '' )
$statement string A simple string the statement should start with or a valid regular expression. Regular expressions must contain delimiters.
$function string
$message string An optional message to override the default one.

assertNotQueriesByStatementAndMethod() публичный Метод

Queries generated by setUp, tearDown and factory methods are excluded by default.
public assertNotQueriesByStatementAndMethod ( string $statement, string $class, string $method, string $message = '' )
$statement string A simple string the statement should start with or a valid regular expression. Regular expressions must contain delimiters.
$class string
$method string
$message string An optional message to override the default one.

assertQueries() публичный Метод

Queries generated by setUp, tearDown and factory methods are excluded by default.
public assertQueries ( string $message = '' )
$message string An optional message to override the default one.

assertQueriesByAction() публичный Метод

Queries generated by setUp, tearDown and factory methods are excluded by default.
public assertQueriesByAction ( string $action, string $message = '' )
$action string The action name, e.g. 'init'.
$message string An optional message to override the default one.

assertQueriesByFilter() публичный Метод

Queries generated by setUp, tearDown and factory methods are excluded by default.
public assertQueriesByFilter ( string $filter, string $message = '' )
$filter string The filter name, e.g. 'posts_where'.
$message string An optional message to override the default one.

assertQueriesByFunction() публичный Метод

Queries generated by setUp, tearDown and factory methods are excluded by default.
public assertQueriesByFunction ( string $function, string $message = '' )
$function string
$message string An optional message to override the default one.

assertQueriesByMethod() публичный Метод

Queries generated by setUp, tearDown and factory methods are excluded by default.
public assertQueriesByMethod ( string $class, string $method, string $message = '' )
$class string
$method string
$message string An optional message to override the default one.

assertQueriesByStatement() публичный Метод

Queries generated by setUp, tearDown and factory methods are excluded by default.
public assertQueriesByStatement ( string $statement, string $message = '' )
$statement string A simple string the statement should start with or a valid regular expression. Regular expressions must contain delimiters.
$message string An optional message to override the default one.

assertQueriesByStatementAndAction() публичный Метод

Queries generated by setUp, tearDown and factory methods are excluded by default.
public assertQueriesByStatementAndAction ( string $statement, string $action, string $message = '' )
$statement string A simple string the statement should start with or a valid regular expression. Regular expressions must contain delimiters.
$action string The action name, e.g. 'init'.
$message string An optional message to override the default one.

assertQueriesByStatementAndFilter() публичный Метод

Queries generated by setUp, tearDown and factory methods are excluded by default.
public assertQueriesByStatementAndFilter ( string $statement, string $filter, string $message = '' )
$statement string A simple string the statement should start with or a valid regular expression. Regular expressions must contain delimiters.
$filter string The filter name, e.g. 'posts_where'.
$message string An optional message to override the default one.

assertQueriesByStatementAndFunction() публичный Метод

Queries generated by setUp, tearDown and factory methods are excluded by default.
public assertQueriesByStatementAndFunction ( string $statement, string $function, string $message = '' )
$statement string A simple string the statement should start with or a valid regular expression. Regular expressions must contain delimiters.
$function string
$message string An optional message to override the default one.

assertQueriesByStatementAndMethod() публичный Метод

Queries generated by setUp, tearDown and factory methods are excluded by default.
public assertQueriesByStatementAndMethod ( string $statement, string $class, string $method, string $message = '' )
$statement string A simple string the statement should start with or a valid regular expression. Regular expressions must contain delimiters.
$class string
$method string
$message string An optional message to override the default one.

assertQueriesCountByAction() публичный Метод

Queries generated by setUp, tearDown and factory methods are excluded by default.
public assertQueriesCountByAction ( integer $n, string $action, string $message = '' )
$n integer The expected number of queries.
$action string The action name, e.g. 'init'.
$message string An optional message to override the default one.

assertQueriesCountByFilter() публичный Метод

Queries generated by setUp, tearDown and factory methods are excluded by default.
public assertQueriesCountByFilter ( integer $n, string $filter, string $message = '' )
$n integer The expected number of queries.
$filter string The filter name, e.g. 'posts_where'.
$message string An optional message to override the default one.

assertQueriesCountByFunction() публичный Метод

Queries generated by setUp, tearDown and factory methods are excluded by default.
public assertQueriesCountByFunction ( integer $n, string $function, string $message = '' )
$n integer The expected number of queries.
$function string
$message string An optional message to override the default one.

assertQueriesCountByMethod() публичный Метод

Queries generated by setUp, tearDown and factory methods are excluded by default.
public assertQueriesCountByMethod ( integer $n, string $class, string $method, string $message = '' )
$n integer The expected number of queries.
$class string
$method string
$message string An optional message to override the default one.

assertQueriesCountByStatement() публичный Метод

Queries generated by setUp, tearDown and factory methods are excluded by default.
public assertQueriesCountByStatement ( integer $n, string $statement, string $message = '' )
$n integer The expected number of queries.
$statement string A simple string the statement should start with or a valid regular expression. Regular expressions must contain delimiters.
$message string An optional message to override the default one.

assertQueriesCountByStatementAndAction() публичный Метод

Queries generated by setUp, tearDown and factory methods are excluded by default.
public assertQueriesCountByStatementAndAction ( integer $n, string $statement, string $action, string $message = '' )
$n integer The expected number of queries.
$statement string A simple string the statement should start with or a valid regular expression. Regular expressions must contain delimiters.
$action string The action name, e.g. 'init'.
$message string An optional message to override the default one.

assertQueriesCountByStatementAndFilter() публичный Метод

Queries generated by setUp, tearDown and factory methods are excluded by default.
public assertQueriesCountByStatementAndFilter ( integer $n, string $statement, string $filter, string $message = '' )
$n integer The expected number of queries.
$statement string A simple string the statement should start with or a valid regular expression. Regular expressions must contain delimiters.
$filter string The filter name, e.g. 'posts_where'.
$message string An optional message to override the default one.

assertQueriesCountByStatementAndFunction() публичный Метод

Queries generated by setUp, tearDown and factory methods are excluded by default.
public assertQueriesCountByStatementAndFunction ( integer $n, string $statement, string $function, string $message = '' )
$n integer The expected number of queries.
$statement string A simple string the statement should start with or a valid regular expression. Regular expressions must contain delimiters.
$function string
$message string An optional message to override the default one.

assertQueriesCountByStatementAndMethod() публичный Метод

Queries generated by setUp, tearDown and factory methods are excluded by default.
public assertQueriesCountByStatementAndMethod ( integer $n, string $statement, string $class, string $method, string $message = '' )
$n integer The expected number of queries.
$statement string A simple string the statement should start with or a valid regular expression. Regular expressions must contain delimiters.
$class string
$method string
$message string An optional message to override the default one.

Описание свойств

$assertions защищенное свойство

protected callable[] $assertions
Результат callable[]

$filteredQueries защищенное свойство

protected array $filteredQueries
Результат array

$wpdb защищенное свойство

protected wpdb $wpdb
Результат wpdb