diff --git a/src/Corley/WordPressExtension/Context/WordPressContext.php b/src/Corley/WordPressExtension/Context/WordPressContext.php index b2000b7..963cc07 100644 --- a/src/Corley/WordPressExtension/Context/WordPressContext.php +++ b/src/Corley/WordPressExtension/Context/WordPressContext.php @@ -19,6 +19,8 @@ class WordPressContext extends MinkContext { /** + * Create a new WordPress website from scratch + * * @Given /^\w+ have|has a vanilla wordpress installation$/ */ public function installWordPress(TableNode $table = null) @@ -47,6 +49,10 @@ public function installWordPress(TableNode $table = null) } /** + * Add these users to this wordpress installation + * + * @see wp_insert_user + * * @Given /^there are users$/ */ public function thereAreUsers(TableNode $table) @@ -59,6 +65,10 @@ public function thereAreUsers(TableNode $table) } /** + * Add these posts to this wordpress installation + * + * @see wp_insert_post + * * @Given /^there are posts$/ */ public function thereArePosts(TableNode $table) @@ -71,6 +81,10 @@ public function thereArePosts(TableNode $table) } /** + * Activate/Deactivate plugins + * | plugin | status | + * | plugin/name.php | enabled | + * * @Given /^there are plugins$/ */ public function thereArePlugins(TableNode $table) @@ -86,6 +100,8 @@ public function thereArePlugins(TableNode $table) /** + * Login into the reserved area of this wordpress + * * @Given /^I am logged in as "([^"]*)" with password "([^"]*)"$/ */ public function login($username, $password) diff --git a/src/Corley/WordPressExtension/EventListener/HookListener.php b/src/Corley/WordPressExtension/EventListener/HookListener.php index 69f50fb..24bcc34 100644 --- a/src/Corley/WordPressExtension/EventListener/HookListener.php +++ b/src/Corley/WordPressExtension/EventListener/HookListener.php @@ -39,6 +39,7 @@ public function beforeSuite(SuiteEvent $event) $_SERVER['HTTP_HOST'] = $url["host"]; $PHP_SELF = $GLOBALS['PHP_SELF'] = $_SERVER['PHP_SELF'] = '/index.php'; + define( 'WP_INSTALLING', true ); require_once $this->path . '/wp-config.php'; } }