login($username, $password); } /** * @When /^I write a post with title "([^"]*)" and content "([^"]*)"$/ */ public function iWriteAPostWithTitleAndContent($post_title, $content) { $this->fill_in_post('post', $post_title, 'publish', $content); } /** * @Given /^the plugin "([^"]*)" is "([^"]*)"$/ */ public function thePluginIs($plugin, $state) { if ($state == "active") { $action = "activate"; } else { $action = "deactivate"; } shell_exec(escapeshellcmd("wp plugin $action $plugin")); } /** * @When /^I search for "([^"]*)"$/ */ public function iSearchFor($term) { return array( new When("I fill in \"s\" with \"$term\""), new When("I press \"searchsubmit\""), ); } }