diff --git a/src/Tests/ProfileDefaultTest.php b/src/Tests/ProfileDefaultTest.php index 64b9ab1..c7270dd 100644 --- a/src/Tests/ProfileDefaultTest.php +++ b/src/Tests/ProfileDefaultTest.php @@ -200,17 +200,9 @@ class ProfileDefaultTest extends ProfileTestBase { $this->clickLink('User profiles'); $this->assertResponse(200); - // Check whether all have links "Mark as default". - $this->assertLinkByHref($profile_profile_type_0_user1_1->toUrl('set-default')->toString()); - $this->assertLinkByHref($profile_profile_type_0_user1_2->toUrl('set-default')->toString()); - $this->assertLinkByHref($profile_profile_type_1_user1->toUrl('set-default')->toString()); - $this->assertLinkByHref($profile_profile_type_1_user2->toUrl('set-default')->toString()); - $this->assertLinkByHref($profile_profile_type_1_user1_inactive->toUrl('set-default')->toString()); - $this->assertLinkByHref($profile_profile_type_1_user1_active->toUrl('set-default')->toString()); - // Mark $profile_profile_type_0_user1_1 as default // $profile_profile_type_0_user1_2 should stay not default. - $this->drupalGet($profile_profile_type_0_user1_1->toUrl('set-default')->toString()); + $this->clickLink('Mark as default', 0); $this->assertTrue(Profile::load($profile_profile_type_0_user1_1->id())->isDefault()); $this->assertFalse($profile_profile_type_0_user1_2->isDefault()); @@ -223,7 +215,7 @@ class ProfileDefaultTest extends ProfileTestBase { // Mark $profile_profile_type_1_user1 as default // $profile_profile_type_1_user2 should stay not default. - $this->drupalGet($profile_profile_type_1_user1->toUrl('set-default')->toString()); + $this->clickLink('Mark as default', 1); $this->assertTrue(Profile::load($profile_profile_type_1_user1->id())->isDefault()); $this->assertFalse($profile_profile_type_1_user2->isDefault()); @@ -235,8 +227,8 @@ class ProfileDefaultTest extends ProfileTestBase { $this->assertTrue(Profile::load($profile_profile_type_1_user1->id())->isDefault()); // Mark $profile_profile_type_1_user1_inactive as default - // $profile_profile_type_1_user1_active should stay not default - $this->drupalGet($profile_profile_type_1_user1_inactive->toUrl('set-default')->toString()); + // $profile_profile_type_1_user1_active should stay not default. + $this->clickLink('Mark as default', 2); $this->assertTrue(Profile::load($profile_profile_type_1_user1_inactive->id())->isDefault()); $this->assertFalse($profile_profile_type_1_user1_active->isDefault());