protected static function AccessManagerTest::convertAccessCheckInterfaceToString

Converts AccessCheckInterface constants to a string.

Parameters

mixed $constant: The access constant which is tested, so either AccessCheckInterface::ALLOW, AccessCheckInterface::DENY OR AccessCheckInterface::KILL.

Return value

string The corresponding string used in route requirements, so 'TRUE', 'FALSE' or 'NULL'.

1 call to AccessManagerTest::convertAccessCheckInterfaceToString()
AccessManagerTest::testCheckConjunctions in drupal/core/tests/Drupal/Tests/Core/Access/AccessManagerTest.php
Test \Drupal\Core\Access\AccessManager::check() with conjunctions.

File

drupal/core/tests/Drupal/Tests/Core/Access/AccessManagerTest.php, line 256
Contains \Drupal\Tests\Core\Access\AccessManagerTest.

Class

AccessManagerTest
Tests the access manager.

Namespace

Drupal\Tests\Core\Access

Code

protected static function convertAccessCheckInterfaceToString($constant) {
  if ($constant === AccessCheckInterface::ALLOW) {
    return 'TRUE';
  }
  if ($constant === AccessCheckInterface::DENY) {
    return 'NULL';
  }
  if ($constant === AccessCheckInterface::KILL) {
    return 'FALSE';
  }
}