public function testAddArray() { $books = ['book' => [['title' => 'Book 01', 'public' => 1999, 'publisher' => 'Publisher 01', 'author' => [['name' => 'Author 01'], ['name' => 'Author 02']]], ['title' => 'Book 02', 'public' => 1999, 'publisher' => 'Publisher 02', 'author' => ['name' => 'Author 04']], ['title' => 'Book 03', 'public' => 1999, 'publisher' => 'Publisher 03', 'author' => [['name' => 'Author 01'], ['name' => 'Author 03']]]]]; $xml = new SimpleXML('<books />'); $xml->addArray($books); $this->assertXmlStringEqualsXmlString($this->_xmlString, $xml->asXml()); }