From a3ca7a945bfa79b1e79e653b8460744c3783a165 Mon Sep 17 00:00:00 2001 From: AaronGilMartinez Date: Wed, 20 Nov 2024 17:33:55 +0100 Subject: [PATCH] Issue CollaboraOnline/collabora-drupal#52: Harcoded entity labels. --- .../tests/src/Functional/GroupMediaViewsTest.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/modules/collabora_online_group/tests/src/Functional/GroupMediaViewsTest.php b/modules/collabora_online_group/tests/src/Functional/GroupMediaViewsTest.php index a6b5f65b..b574ba74 100644 --- a/modules/collabora_online_group/tests/src/Functional/GroupMediaViewsTest.php +++ b/modules/collabora_online_group/tests/src/Functional/GroupMediaViewsTest.php @@ -43,7 +43,10 @@ class GroupMediaViewsTest extends BrowserTestBase { public function testViewLinks(): void { // Add configuration needed for testing. $group_type = $this->createGroupType(['id' => 'group_type_1']); - $media_type = $this->createMediaType('file', ['id' => 'document']); + $this->createMediaType('file', [ + 'id' => 'document', + 'label' => 'Document', + ]); $this->createGroupRole([ 'group_type' => 'group_type_1', 'scope' => PermissionScopeInterface::INSIDER_ID, @@ -64,7 +67,7 @@ public function testViewLinks(): void { // Create content. $group = $this->createGroup(['type' => 'group_type_1']); - for ($i = 1; $i < 4; $i++) { + for ($i = 0; $i < 3; $i++) { $media = $this->createMediaEntity('document', [ 'id' => 'media_' . $i, 'name' => 'Media ' . $i, @@ -101,8 +104,8 @@ public function testViewLinks(): void { $i = 0; foreach (Media::loadMultiple() as $media) { $cols = $rows[$i]->findAll('css', 'td'); - $this->assertEquals($media->getName(), $cols[0]->getText()); - $this->assertEquals($media_type->label(), $cols[1]->getText()); + $this->assertEquals('Media ' . $i, $cols[0]->getText()); + $this->assertEquals('Document', $cols[1]->getText()); $this->assertEquals('Yes', $cols[2]->getText()); $this->assertEquals('Anonymous', $cols[3]->getText()); $operation_links = $cols[4]->findAll('css', 'a');