Skip to content
Snippets Groups Projects
Commit ec68e702 authored by catch's avatar catch
Browse files

Issue #3385846 by pooja_sharma, joachim: FileOnTranslatedEntityTest should use...

Issue #3385846 by pooja_sharma, joachim: FileOnTranslatedEntityTest should use API to set up language

(cherry picked from commit b6c3c60a)
parent ee352be7
No related branches found
No related tags found
3 merge requests!11769Issue #3517987: Add option to contextual filters to encode slashes in query parameter.,!11185Issue #3477324 by andypost, alexpott: Fix usage of str_getcsv() and fgetcsv() for PHP 8.4,!9944Issue #3483353: Consider making the createCopy config action optionally fail...
Pipeline #249975 passed
......@@ -5,6 +5,7 @@
namespace Drupal\Tests\file\Functional;
use Drupal\file\Entity\File;
use Drupal\node\Entity\Node;
use Drupal\Tests\content_translation\Traits\ContentTranslationTestTrait;
// cspell:ignore Scarlett Johansson
......@@ -217,13 +218,6 @@ public function testFileUsage(): void {
/** @var \Drupal\file\FileUsage\FileUsageInterface $file_usage */
$file_usage = \Drupal::service('file.usage');
// Enable language selector on the page edit form.
$edit = [
'language_configuration[language_alterable]' => 1,
];
$this->drupalGet('admin/structure/types/manage/page');
$this->submitForm($edit, 'Save');
// Create a node and upload a file.
$node = $this->drupalCreateNode(['type' => 'page']);
$edit = [
......@@ -238,11 +232,9 @@ public function testFileUsage(): void {
// Check if the file usage is tracked correctly when changing the original
// language of an entity.
$edit = [
'langcode[0][value]' => 'fr',
];
$this->drupalGet('node/' . $node->id() . '/edit');
$this->submitForm($edit, 'Save');
$node = Node::load($node->id());
$node->set('langcode', 'fr');
$node->save();
$this->assertEquals($file_usage->listUsage($file), ['file' => ['node' => [$node->id() => '1']]]);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment