fix collections test for updated collections config

This commit is contained in:
Damodar Lohani
2023-06-01 05:25:22 +00:00
parent d24d77e2c9
commit 2807a22d3b
+10 -8
View File
@@ -15,16 +15,18 @@ class CollectionsTest extends TestCase
public function testDuplicateRules(): void
{
foreach ($this->collections as $key => $collection) {
if (array_key_exists('attributes', $collection)) {
foreach ($collection['attributes'] as $check) {
$occurrences = 0;
foreach ($collection['attributes'] as $attribute) {
if ($attribute['$id'] == $check['$id']) {
$occurrences++;
foreach ($this->collections as $key => $sections) {
foreach ($sections as $key => $collection) {
if (array_key_exists('attributes', $collection)) {
foreach ($collection['attributes'] as $check) {
$occurrences = 0;
foreach ($collection['attributes'] as $attribute) {
if ($attribute['$id'] == $check['$id']) {
$occurrences++;
}
}
$this->assertEquals(1, $occurrences);
}
$this->assertEquals(1, $occurrences);
}
}
}