function testDuplicateIdsError() { $root = new lmbMacroNode(); $child1 = new lmbMacroNode(new lmbMacroSourceLocation('my_file', 10)); $child1->setNodeId('my_tag'); $root->addChild($child1); $child2 = new lmbMacroNode(new lmbMacroSourceLocation('my_file2', 15)); $child2->setNodeId('my_tag'); $root->addChild($child2); try { $root->checkChildrenIds(); $this->assertTrue(false); } catch (lmbMacroException $e) { $this->assertPattern('/Duplicate "id" attribute/', $e->getMessage()); $params = $e->getParams(); $this->assertEqual($params['file'], 'my_file2'); $this->assertEqual($params['line'], 15); $this->assertEqual($params['duplicate_node_file'], 'my_file'); $this->assertEqual($params['duplicate_node_line'], 10); } }