class PathProcessorTest

Same name in this branch
  1. 11.x core/modules/system/tests/modules/url_alter_test/src/PathProcessorTest.php \Drupal\url_alter_test\PathProcessorTest
  2. 11.x core/tests/Drupal/Tests/Core/PathProcessor/PathProcessorTest.php \Drupal\Tests\Core\PathProcessor\PathProcessorTest
Same name in other branches
  1. 9 core/modules/system/tests/modules/url_alter_test/src/PathProcessorTest.php \Drupal\url_alter_test\PathProcessorTest
  2. 9 core/tests/Drupal/Tests/Core/PathProcessor/PathProcessorTest.php \Drupal\Tests\Core\PathProcessor\PathProcessorTest
  3. 8.9.x core/modules/system/tests/modules/url_alter_test/src/PathProcessorTest.php \Drupal\url_alter_test\PathProcessorTest
  4. 8.9.x core/tests/Drupal/Tests/Core/PathProcessor/PathProcessorTest.php \Drupal\Tests\Core\PathProcessor\PathProcessorTest
  5. 10 core/modules/forum/tests/modules/forum_url_alter_test/src/PathProcessorTest.php \Drupal\forum_url_alter_test\PathProcessorTest
  6. 10 core/modules/system/tests/modules/url_alter_test/src/PathProcessorTest.php \Drupal\url_alter_test\PathProcessorTest
  7. 10 core/tests/Drupal/Tests/Core/PathProcessor/PathProcessorTest.php \Drupal\Tests\Core\PathProcessor\PathProcessorTest

Path processor for url_alter_test.

Hierarchy

Expanded class hierarchy of PathProcessorTest

1 string reference to 'PathProcessorTest'
forum_url_alter_test.services.yml in core/modules/forum/tests/modules/forum_url_alter_test/forum_url_alter_test.services.yml
core/modules/forum/tests/modules/forum_url_alter_test/forum_url_alter_test.services.yml
1 service uses PathProcessorTest
forum_url_alter_test.path_processor in core/modules/forum/tests/modules/forum_url_alter_test/forum_url_alter_test.services.yml
Drupal\forum_url_alter_test\PathProcessorTest

File

core/modules/forum/tests/modules/forum_url_alter_test/src/PathProcessorTest.php, line 13

Namespace

Drupal\forum_url_alter_test
View source
class PathProcessorTest implements InboundPathProcessorInterface, OutboundPathProcessorInterface {
    
    /**
     * {@inheritdoc}
     */
    public function processInbound($path, Request $request) {
        // Rewrite community/ to forum/.
        return preg_replace('@^/community(.*)@', '/forum$1', $path);
    }
    
    /**
     * {@inheritdoc}
     */
    public function processOutbound($path, &$options = [], Request $request = NULL, BubbleableMetadata $bubbleable_metadata = NULL) {
        // Rewrite forum/ to community/.
        return preg_replace('@^/forum(.*)@', '/community$1', $path);
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
PathProcessorTest::processInbound public function Processes the inbound path. Overrides InboundPathProcessorInterface::processInbound
PathProcessorTest::processOutbound public function Processes the outbound path. Overrides OutboundPathProcessorInterface::processOutbound

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.