1
0
Fork 0
mirror of synced 2024-06-02 19:04:49 +12:00
appwrite/tests/unit/General/CollectionsTest.php
Torsten Dittmann d97e1674aa tests: fix
2021-04-14 15:07:26 +02:00

37 lines
870 B
PHP

<?php
namespace Appwrite\Tests;
use PHPUnit\Framework\TestCase;
class CollectionsTest extends TestCase
{
protected $collections;
public function setUp(): void
{
$this->collections = require('app/config/collections.php');
}
public function tearDown(): void
{
}
public function testDuplicateRules()
{
foreach ($this->collections as $collection) {
if (in_array('rules', $collection)) {
foreach ($collection['rules'] as $check) {
$occurences = 0;
foreach ($collection['rules'] as $rule) {
if ($rule['key'] == $check['key']) {
$occurences++;
}
}
$this->assertEquals(1, $occurences);
}
}
}
}
}