You are here

public function ExecuteCodeTest::testOutputBuffer in Devel PHP 8

Tests output buffer.

File

tests/src/Functional/ExecuteCodeTest.php, line 62

Class

ExecuteCodeTest
Tests execute code.

Namespace

Drupal\Tests\devel_php\Functional

Code

public function testOutputBuffer() {
  $edit = [];
  $url = Url::fromRoute('devel_php.execute_php');
  $user = $this
    ->drupalCreateUser([
    'access devel information',
    'execute php code',
  ]);
  $this
    ->drupalLogin($user);
  $this
    ->drupalGet($url);
  $edit['code'] = 'echo \\Drupal::VERSION;';
  $this
    ->submitForm($edit, $this
    ->t('Execute'));
  $this
    ->assertSession()
    ->pageTextContains(\Drupal::VERSION);
}