PHP 클래스 Codeception\Module\WPQueries

WordPress queries based assertions.
상속: extends Codeception\Module
파일 보기 프로젝트 열기: lucatume/wp-browser

보호된 프로퍼티들

프로퍼티 타입 설명
$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