executeCommand($php_finder->find() . ' ./core/scripts/drupal install ' . $profile, $working_dir); $this->assertCommandOutputContains('Username:'); preg_match('/Username: (.+)\vPassword: (.+)/', $install_process->getOutput(), $matches); $this->assertNotEmpty($this->adminUsername = $matches[1]); $this->assertNotEmpty($this->adminPassword = $matches[2]); } /** * Helper that uses Drupal's user/login form to log in. * * @param string $username * Username. * @param string $password * Password. * @param string $working_dir * (optional) A working directory within which to login. Defaults to the * workspace directory. */ public function formLogin($username, $password, $working_dir = NULL) { $this->visit('/user/login', $working_dir); $assert = $this->getMink()->assertSession(); $assert->statusCodeEquals(200); $assert->fieldExists('edit-name')->setValue($username); $assert->fieldExists('edit-pass')->setValue($password); $session = $this->getMink()->getSession(); $session->getPage()->findButton('Log in')->submit(); } }