diff --git a/core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTest.php b/core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTest.php index bece149..72308f0 100644 --- a/core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTest.php +++ b/core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTest.php @@ -203,50 +203,6 @@ public function testUrlGenerationWithHttpsRequirement() { } /** - * Tests the Cached URL Generator. - */ - public function testCachedUrlGenerator() { - $system_path = 'some_path'; - - // Mock a cache backend to pass to the CachedUrlGenerator. - $cache = $this->getMock('Drupal\Core\Cache\CacheBackendInterface'); - // Set an expectation that the get() method will be called on the - // mock cache backend and make it return a cache object with one - // cached URL. - $cache->expects($this->at(0)) - ->method('get') - ->with($this->equalTo($system_path)) - ->will($this->returnValue((object) array('data' => array(CachedUrlGenerator::PATH_CACHE_PREFIX . 'first_path' => 'foo')))); - // Set an expectation that the set() method will be called on the - // mock cache backend with an array containing two URLS. - $cache->expects($this->at(1)) - ->method('set') - ->with($this->equalTo($system_path), $this->equalTo(array(CachedUrlGenerator::PATH_CACHE_PREFIX . 'first_path' => 'foo', CachedUrlGenerator::PATH_CACHE_PREFIX . 'second_path' => 'bar'))); - - // Mock a UrlGenerator to pass to the CachedUrlGenerator. - $url_generator = $this->getMockBuilder('Drupal\Core\Routing\UrlGenerator') - ->disableOriginalConstructor() - ->getMock(); - - // The decorated url generator should only be consulted - // once, for the second path, which was not in the cache. - $url_generator->expects($this->once()) - ->method('generateFromPath') - ->with($this->equalTo('second_path'), $this->anything()) - ->will($this->returnValue('bar')); - - // Instantiate a CachedUrlGenerator and call various methods - // on it to ensure the expectations we set on our mocks are met. - $cached_url_generator = new CachedUrlGenerator($url_generator, $cache); - $request = Request::create('some/path'); - $request->attributes->set('system_path', $system_path); - $cached_url_generator->setRequest($request); - $url = $cached_url_generator->generateFromPath('first_path'); - $url = $cached_url_generator->generateFromPath('second_path'); - $cached_url_generator->destruct(); - } - - /** * Tests path-based URL generation. */ public function testPathBasedURLGeneration() {