Skip to content
This repository has been archived by the owner on Aug 18, 2024. It is now read-only.

Commit

Permalink
Avoid random failures when field names are returned in a different or…
Browse files Browse the repository at this point in the history
…der.
  • Loading branch information
pfrenssen committed Dec 8, 2019
1 parent 04e9583 commit c620993
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/src/Kernel/Entity/GroupAudienceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,12 @@ public function testGetAllGroupAudienceFields() {
Og::createField(OgGroupAudienceHelperInterface::DEFAULT_FIELD, 'entity_test', $bundle, ['field_name' => $field_name1]);
Og::createField(OgGroupAudienceHelperInterface::DEFAULT_FIELD, 'entity_test', $bundle, ['field_name' => $field_name2]);

$field_names = $this->groupAudienceHelper->getAllGroupAudienceFields('entity_test', $bundle);
$this->assertEquals([$field_name1, $field_name2], array_keys($field_names));
$expected_field_names = [$field_name1, $field_name2];
$actual_field_names = array_keys($this->groupAudienceHelper->getAllGroupAudienceFields('entity_test', $bundle));
sort($expected_field_names);
sort($actual_field_names);

$this->assertEquals($expected_field_names, $actual_field_names);

// Test Og::isGroupContent method, which is just a wrapper around
// OgGroupAudienceHelper::hasGroupAudienceFields().
Expand Down

0 comments on commit c620993

Please sign in to comment.