/** * @testdox Tags that are allowed in a closed dependency loop are omitted from the return array */ public function testUnusedTagsInLoop() { $tags = new TagCollection(); $tags->add('A'); $tags->add('B'); $rootRules = new Ruleset(); $rootRules->denyChild('A'); $rootRules->denyChild('B'); $this->assertEquals(['root' => ['allowed' => [0]], 'tags' => []], RulesHelper::getBitfields($tags, $rootRules)); }
/** * @testdox denyChild() normalizes tag names */ public function testDenyChildNormalizesTagName() { $ruleset = new Ruleset(); $ruleset->denyChild('b'); $this->assertEquals(['defaultChildRule' => 'allow', 'defaultDescendantRule' => 'allow', 'denyChild' => ['B']], iterator_to_array($ruleset)); }