radarrplexorganizrnginxsonarrdashboardembycouchpotatonzbgetbookmarkapplication-dashboardmuximuxlandingpagestartpagelandinghtpcserverhomepagesabnzbdheimdall
		
		
		
		
			You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							43 lines
						
					
					
						
							1.3 KiB
						
					
					
				
			
		
		
		
			
			
			
				
					
				
				
					
				
			
		
		
	
	
							43 lines
						
					
					
						
							1.3 KiB
						
					
					
				
								<?php declare(strict_types = 1);
							 | 
						|
								namespace TheSeer\Tokenizer;
							 | 
						|
								
							 | 
						|
								use  PHPUnit\Framework\TestCase;
							 | 
						|
								
							 | 
						|
								/**
							 | 
						|
								 * @covers \TheSeer\Tokenizer\XMLSerializer
							 | 
						|
								 */
							 | 
						|
								class XMLSerializerTest extends TestCase {
							 | 
						|
								
							 | 
						|
								    /** @var TokenCollection $tokens */
							 | 
						|
								    private $tokens;
							 | 
						|
								
							 | 
						|
								    protected function setUp() {
							 | 
						|
								        $this->tokens = unserialize(
							 | 
						|
								            file_get_contents(__DIR__ . '/_files/test.php.tokens'),
							 | 
						|
								            [TokenCollection::class]
							 | 
						|
								        );
							 | 
						|
								    }
							 | 
						|
								
							 | 
						|
								    public function testCanBeSerializedToXml() {
							 | 
						|
								        $expected = file_get_contents(__DIR__ . '/_files/test.php.xml');
							 | 
						|
								
							 | 
						|
								        $serializer = new XMLSerializer();
							 | 
						|
								        $this->assertEquals($expected, $serializer->toXML($this->tokens));
							 | 
						|
								    }
							 | 
						|
								
							 | 
						|
								    public function testCanBeSerializedToDomDocument() {
							 | 
						|
								        $serializer = new XMLSerializer();
							 | 
						|
								        $result = $serializer->toDom($this->tokens);
							 | 
						|
								
							 | 
						|
								        $this->assertInstanceOf(\DOMDocument::class, $result);
							 | 
						|
								        $this->assertEquals('source', $result->documentElement->localName);
							 | 
						|
								    }
							 | 
						|
								
							 | 
						|
								    public function testCanBeSerializedToXmlWithCustomNamespace() {
							 | 
						|
								        $expected = file_get_contents(__DIR__ . '/_files/customns.xml');
							 | 
						|
								
							 | 
						|
								        $serializer = new XMLSerializer(new NamespaceUri('custom:xml:namespace'));
							 | 
						|
								        $this->assertEquals($expected, $serializer->toXML($this->tokens));
							 | 
						|
								    }
							 | 
						|
								
							 | 
						|
								}
							 | 
						|
								
							 |