public function testAjax() { $this->module->sendAjaxGetRequest('/info'); $this->assertNotNull(data::get('ajax')); $this->module->sendAjaxPostRequest('/form/complex', array('show' => 'author')); $this->assertNotNull(data::get('ajax')); $post = data::get('form'); $this->assertEquals('author', $post['show']); }
public function testMultipleCookies() { $this->module->amOnPage('/'); $this->module->sendAjaxPostRequest('/cookies'); $this->module->seeCookie('foo', 'bar1'); $this->module->seeCookie('baz', 'bar2'); $this->module->setCookie('foo', 'bar1'); $this->module->setCookie('baz', 'bar2'); $this->module->amOnPage('/cookies'); $this->module->seeInCurrentUrl('info'); }
/** * Get facebook test user be logged in on facebook. * * @throws ModuleConfigException */ public function haveTestUserLoggedInOnFacebook() { if (!array_key_exists('id', $this->testUser)) { throw new ModuleException(__CLASS__, 'Facebook test user was not found. Did you forget to create one?'); } // go to facebook and make login; it work only if you visit facebook.com first $this->phpBrowser->amOnPage('https://www.facebook.com/'); $this->phpBrowser->sendAjaxPostRequest('login.php', ['email' => $this->grabFacebookTestUserEmail(), 'pass' => $this->testUser['password']]); $this->phpBrowser->see($this->grabFacebookTestUserName()); }