diff --git a/core/modules/file/lib/Drupal/file/Plugin/views/argument/Fid.php b/core/modules/file/lib/Drupal/file/Plugin/views/argument/Fid.php index da44a26..e373e8b 100644 --- a/core/modules/file/lib/Drupal/file/Plugin/views/argument/Fid.php +++ b/core/modules/file/lib/Drupal/file/Plugin/views/argument/Fid.php @@ -39,7 +39,7 @@ class Fid extends Numeric implements ContainerFactoryPluginInterface { protected $entityQuery; /** - * Constructs a Drupal\Component\Plugin\PluginBase object. + * Constructs a Drupal\file\Plugin\views\argument\Fid object. * * @param array $configuration * A configuration array containing information about the plugin instance. @@ -49,10 +49,13 @@ class Fid extends Numeric implements ContainerFactoryPluginInterface { * The plugin implementation definition. * @param \Drupal\Core\Entity\EntityManager $entity_manager * The entity manager. + * @param \Drupal\Core\Entity\Query\QueryFactory + * The entity query factory. */ - public function __construct(array $configuration, $plugin_id, array $plugin_definition, EntityManager $entity_manager, QueryFactory $entityQuery) { + public function __construct(array $configuration, $plugin_id, array $plugin_definition, EntityManager $entity_manager, QueryFactory $entity_query) { parent::__construct($configuration, $plugin_id, $plugin_definition); $this->entityManager = $entity_manager; + $this->entityQuery = $entity_query; } /** diff --git a/core/modules/file/lib/Drupal/file/Tests/FileListingTest.php b/core/modules/file/lib/Drupal/file/Tests/FileListingTest.php index d0681b2..3126560 100644 --- a/core/modules/file/lib/Drupal/file/Tests/FileListingTest.php +++ b/core/modules/file/lib/Drupal/file/Tests/FileListingTest.php @@ -111,5 +111,24 @@ function testFileListingPages() { $result = $this->xpath("//td[contains(@class, 'views-field-status') and contains(text(), :value)]", array(':value' => t('Temporary'))); $this->assertEqual(1, count($result), 'Unused file marked as temporary.'); + + // Test file usage page. + foreach ($nodes as $node) { + $file = entity_load('file', $node->file->target_id); + $usage = file_usage()->listUsage($file); + $this->drupalGet('admin/content/files/usage/' . $file->id()); + $this->assertResponse(200); + $this->assertText($node->getTitle(), 'Node title found on usage page.'); + $this->assertText('node', 'Registering entity type found on usage page.'); + $this->assertText('file', 'Registering module found on usage page.'); + foreach ($usage as $module) { + foreach ($module as $entity_type) { + foreach ($entity_type as $entity) { + $this->assertText($entity, 'Usage count found on usage page.'); + } + } + } + $this->assertLinkByHref('node/' . $node->id(), 0, 'Link to registering entity found on usage page.'); + } } }