/**
  * Tests the access method with an invalid language.
  */
 public function testAccessWithInvalidLanguage()
 {
     $entity = $this->createMockEntity();
     $entity->expects($this->once())->method('hasTranslation')->with('xx-lolspeak')->will($this->returnValue(FALSE));
     $request = new Request();
     $field_name = 'valid';
     $request->attributes->set('entity_type', 'entity_test');
     $request->attributes->set('entity', $entity);
     $request->attributes->set('field_name', $field_name);
     $request->attributes->set('langcode', 'xx-lolspeak');
     $account = $this->getMock('Drupal\\Core\\Session\\AccountInterface');
     $this->assertSame(AccessCheckInterface::KILL, $this->editAccessCheck->access($request, $field_name, $account));
 }
 /**
  * Tests checking access to routes that result in AccessResult::isForbidden().
  *
  * @dataProvider providerTestAccessForbidden
  */
 public function testAccessForbidden($field_name, $langcode)
 {
     $account = $this->getMock('Drupal\\Core\\Session\\AccountInterface');
     $entity = $this->createMockEntity();
     $this->assertEquals(AccessResult::forbidden(), $this->editAccessCheck->access($entity, $field_name, $langcode, $account));
 }