WebTestCase('new domain'); } function testNewDomain() { global $user; // open website $this->get('http://' . BASE_URL); $this->assertText('Login'); $this->clickLink('Normal Login'); $this->assertText('Pass Phrase:'); // login $this->setField('email', $user['1']['username']); $this->setField('pword', $user['1']['password']); $this->clickSubmit('Login'); $this->assertText('Logout', "Login failed - don't see logout button"); $this->get('http://' . BASE_URL."account.php?id=1"); $this->assertField('newemail', "", "Don't see field for newemail"); $this->setField('newemail', $user['1']['newemail']); $this->clickSubmit('Add'); $this->assertText('has been added to the system', "couldn't add new email to the system"); $this->assertNoText('is already in the system', "the email provided is already in the system"); $this->assertNoText('Not a valid email address', "string provided is not a valid email address"); sleep(5); // Check if email has been added $rawpage = $this->get('http://' . BASE_URL."account.php?id=2"); // U is for ungreedy - find smallest match // s searches in multiple lines $this->assertNoPattern('/