PhpAccessTest.php in PHP 8
File
src/Tests/Functional/PhpAccessTest.php
View source
<?php
namespace Drupal\Tests\php\Functional;
class PhpAccessTest extends PhpTestBase {
public function testNoPrivileges() {
$permissions = [
'access content',
'create page content',
'edit own page content',
];
$web_user = $this
->drupalCreateUser($permissions);
$this
->drupalLogin($web_user);
$node = $this
->createNodeWithCode();
$this
->drupalGet('node/' . $node
->id());
$this
->assertText('print', 'PHP code was not evaluated.');
$this
->drupalGet('node/' . $node
->id() . '/edit');
$this
->assertNoRaw('<option value="' . $this->phpCodeFormat
->id() . '">', 'PHP code format not available.');
}
}
Classes
Name |
Description |
PhpAccessTest |
Tests to make sure access to the PHP filter is properly restricted. |