1*a1a3b679SAndreas Boehler<?php 2*a1a3b679SAndreas Boehler 3*a1a3b679SAndreas Boehlernamespace Sabre\DAV\Exception; 4*a1a3b679SAndreas Boehler 5*a1a3b679SAndreas Boehleruse 6*a1a3b679SAndreas Boehler Sabre\DAV, 7*a1a3b679SAndreas Boehler DOMDocument; 8*a1a3b679SAndreas Boehler 9*a1a3b679SAndreas Boehlerclass TooManyMatchesTest extends \PHPUnit_Framework_TestCase { 10*a1a3b679SAndreas Boehler 11*a1a3b679SAndreas Boehler function testSerialize() { 12*a1a3b679SAndreas Boehler 13*a1a3b679SAndreas Boehler $dom = new DOMDocument('1.0'); 14*a1a3b679SAndreas Boehler $dom->formatOutput = true; 15*a1a3b679SAndreas Boehler $root = $dom->createElement('d:root'); 16*a1a3b679SAndreas Boehler 17*a1a3b679SAndreas Boehler $dom->appendChild($root); 18*a1a3b679SAndreas Boehler $root->setAttribute('xmlns:d','DAV:'); 19*a1a3b679SAndreas Boehler 20*a1a3b679SAndreas Boehler $locked = new TooManyMatches(); 21*a1a3b679SAndreas Boehler 22*a1a3b679SAndreas Boehler $locked->serialize(new DAV\Server(), $root); 23*a1a3b679SAndreas Boehler 24*a1a3b679SAndreas Boehler $output = $dom->saveXML(); 25*a1a3b679SAndreas Boehler 26*a1a3b679SAndreas Boehler $expected = '<?xml version="1.0"?> 27*a1a3b679SAndreas Boehler<d:root xmlns:d="DAV:"> 28*a1a3b679SAndreas Boehler <d:number-of-matches-within-limits xmlns:d="DAV:"/> 29*a1a3b679SAndreas Boehler</d:root> 30*a1a3b679SAndreas Boehler'; 31*a1a3b679SAndreas Boehler 32*a1a3b679SAndreas Boehler $this->assertEquals($expected, $output); 33*a1a3b679SAndreas Boehler 34*a1a3b679SAndreas Boehler } 35*a1a3b679SAndreas Boehler 36*a1a3b679SAndreas Boehler} 37