PHP Class Codeception\Module\WordPress

Inheritance: extends Codeception\Lib\Framework, implements Codeception\Lib\Interfaces\DependsOnModule
Show file Open project: lucatume/wp-browser

Public Properties

Property Type Description
$client tad\WPBrowser\Connector\WordPress

Protected Properties

Property Type Description
$adminPath string
$config array
$dependencyMessage string
$isMockRequest boolean
$lastRequestWasAdmin boolean
$requiredFields array
$siteUrl string
$wpdbModule WPDb

Public Methods

Method Description
__construct ( Codeception\Lib\ModuleContainer $moduleContainer, array $config = [], WordPress $client = null ) WordPress constructor.
_after ( Codeception\TestInterface $test )
_afterStep ( Codeception\Step $step )
_afterSuite ( )
_before ( Codeception\TestInterface $test )
_beforeStep ( Codeception\Step $step )
_beforeSuite ( $settings = [] )
_cleanup ( )
_depends ( ) : array Specifies class or module which is required for current one.
_failed ( Codeception\TestInterface $test, $fail )
_initialize ( )
_inject ( WPDb $wpdbModule )
_isMockRequest ( $isMockRequest = false )
_lastRequestWasAdmin ( )
_setClient ( $client )
amEditingPostWithId ( $id )
amOnAdminAjaxPage ( )
amOnAdminPage ( $page )
amOnCronPage ( )
amOnPage ( string $page ) : null | string
getInternalDomains ( ) : array Returns a list of recognized domain names
loginAs ( $user, $password )
loginAsAdmin ( )
setAdminPath ( $adminPath )

Protected Methods

Method Description
getAbsoluteUrlFor ( $uri )

Private Methods

Method Description
ensureWpRoot ( )
isAdminPageRequest ( $page )
preparePage ( $page ) : string
setRequestType ( $page )
setupClient ( $siteDomain )
untrailslashIt ( $path ) : mixed

Method Details

__construct() public method

WordPress constructor.
public __construct ( Codeception\Lib\ModuleContainer $moduleContainer, array $config = [], WordPress $client = null )
$moduleContainer Codeception\Lib\ModuleContainer
$config array
$client tad\WPBrowser\Connector\WordPress

_after() public method

public _after ( Codeception\TestInterface $test )
$test Codeception\TestInterface

_afterStep() public method

public _afterStep ( Codeception\Step $step )
$step Codeception\Step

_afterSuite() public method

public _afterSuite ( )

_before() public method

public _before ( Codeception\TestInterface $test )
$test Codeception\TestInterface

_beforeStep() public method

public _beforeStep ( Codeception\Step $step )
$step Codeception\Step

_beforeSuite() public method

public _beforeSuite ( $settings = [] )

_cleanup() public method

public _cleanup ( )

_depends() public method

THis method should return array with key as class name and value as error message [className => errorMessage]
public _depends ( ) : array
return array

_failed() public method

public _failed ( Codeception\TestInterface $test, $fail )
$test Codeception\TestInterface

_initialize() public method

public _initialize ( )

_inject() public method

public _inject ( WPDb $wpdbModule )
$wpdbModule WPDb

_isMockRequest() public method

public _isMockRequest ( $isMockRequest = false )

_lastRequestWasAdmin() public method

_setClient() public method

public _setClient ( $client )

amEditingPostWithId() public method

public amEditingPostWithId ( $id )

amOnAdminAjaxPage() public method

public amOnAdminAjaxPage ( )

amOnAdminPage() public method

public amOnAdminPage ( $page )

amOnCronPage() public method

public amOnCronPage ( )

amOnPage() public method

public amOnPage ( string $page ) : null | string
$page string The relative path to a page.
return null | string

getAbsoluteUrlFor() protected method

protected getAbsoluteUrlFor ( $uri )

getInternalDomains() public method

Returns a list of recognized domain names
public getInternalDomains ( ) : array
return array

loginAs() public method

public loginAs ( $user, $password )

loginAsAdmin() public method

public loginAsAdmin ( )

setAdminPath() public method

public setAdminPath ( $adminPath )

Property Details

$adminPath protected property

protected string $adminPath
return string

$client public property

public WordPress,tad\WPBrowser\Connector $client
return tad\WPBrowser\Connector\WordPress

$config protected property

protected array $config
return array

$dependencyMessage protected property

protected string $dependencyMessage
return string

$isMockRequest protected property

protected bool $isMockRequest
return boolean

$lastRequestWasAdmin protected property

protected bool $lastRequestWasAdmin
return boolean

$requiredFields protected property

protected array $requiredFields
return array

$siteUrl protected property

protected string $siteUrl
return string

$wpdbModule protected property

protected WPDb,Codeception\Module $wpdbModule
return WPDb