/** * @testdox merge() accepts an instance of Ruleset to copy its content */ public function testMergeInstanceOfRuleset() { $ruleset1 = new Ruleset(); $ruleset1->allowChild('B'); $ruleset2 = new Ruleset(); $ruleset2->merge($ruleset1); $this->assertEquals($ruleset1, $ruleset2); }
/** * @testdox $tag->rules can be assigned an instance of Ruleset to copy its content */ public function testRulesInstanceOfRuleset() { $ruleset = new Ruleset(); $ruleset->allowChild('B'); $tag = new Tag(); $tag->rules = $ruleset; $this->assertEquals($ruleset, $tag->rules); $this->assertNotSame($ruleset, $tag->rules, '$tag->rules should not have been replaced with $ruleset'); }