Skip to content
Snippets Groups Projects
Commit 260ec84b authored by Florent Torregrosa's avatar Florent Torregrosa
Browse files

Issue #3437169 by oldeb, Grimreaper: Fix tests

parent fd510130
No related branches found
No related tags found
1 merge request!12Issue #3437169 by oldeb, Grimreaper: Fix tests
Pipeline #200327 passed with warnings
......@@ -71,15 +71,15 @@ class ExecuteCodeTest extends BrowserTestBase {
$this->drupalGet($url);
$edit['code'] = 'devel_help()';
$this->submitForm($edit, $this->t('Execute'));
$this->submitForm($edit, 'Execute');
$this->assertSession()->pageTextContains('syntax error, unexpected end of file');
$edit['code'] = 'devel_help2();';
$this->submitForm($edit, $this->t('Execute'));
$this->submitForm($edit, 'Execute');
$this->assertSession()->pageTextContains('Call to undefined function devel_help2()');
$edit['code'] = 'devel_help();';
$this->submitForm($edit, $this->t('Execute'));
$this->submitForm($edit, 'Execute');
$this->assertSession()->pageTextContains('Too few arguments to function devel_help(), 0 passed');
}
......@@ -87,16 +87,17 @@ class ExecuteCodeTest extends BrowserTestBase {
* Tests output buffer.
*/
public function testOutputBuffer(): void {
$edit = [];
$url = Url::fromRoute('devel_php.execute_php');
$this->drupalLogin($this->user);
$this->drupalGet($url);
$this->assertSession()->pageTextNotContains(\Drupal::VERSION);
$edit = [];
$edit['code'] = 'echo \Drupal::VERSION;';
$this->submitForm($edit, $this->t('Execute'));
$this->assertSession()->pageTextContains(\Drupal::VERSION);
$this->submitForm($edit, 'Execute');
$elements = $this->xpath('//div[@aria-label="Status message"]/pre/span[contains(text(), :message)]', [':message' => \Drupal::VERSION]);
$this->assertNotEmpty($elements, 'Dumped message is present.');
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment