diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityAccessCheckTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityAccessCheckTest.php index 0de9b60..2510c45 100644 --- a/core/tests/Drupal/Tests/Core/Entity/EntityAccessCheckTest.php +++ b/core/tests/Drupal/Tests/Core/Entity/EntityAccessCheckTest.php @@ -8,6 +8,7 @@ namespace Drupal\Tests\Core\Entity; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Routing\Route; use Drupal\Core\Entity\EntityAccessCheck; use Drupal\Tests\UnitTestCase; @@ -51,21 +52,16 @@ public function testApplies() { $this->assertEquals(FALSE, $res); } - /** * Tests the method for checking access to routes. */ public function testAccess() { - $args = array('/foo', array(), array('_entity_access' => 'node.update')); - $route = $this->getMockBuilder('Symfony\Component\Routing\Route') - ->setConstructorArgs($args) - ->getMock(); - $request = $this->getMockBuilder('Symfony\Component\HttpFoundation\Request') - ->disableOriginalConstructor() - ->getMock(); + $route = new Route('/foo', array(), array('_entity_access: node.update')); + $request = new Request; + $request->attributes = 'node'; $access_check = new EntityAccessCheck(); - $operation = $access_check->access($route, $request); - $this->assertEquals(TRUE, $operation); + $access = $access_check->access($route, $request); + $this->assertEquals(TRUE, $access); } }