 aef4d711f5
			
		
	
	
		aef4d711f5
		
			
		
	
	
	
	
		
			
			Because even if it doesn't make a difference in practice, it is technically more correct to call static methods statically. It also better advertise that those methods can be used from any context.
		
			
				
	
	
		
			41 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			41 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| 
 | |
| namespace PhpOffice\PhpSpreadsheetTests;
 | |
| 
 | |
| use PhpOffice\PhpSpreadsheet\Settings;
 | |
| use PHPUnit_Framework_TestCase;
 | |
| 
 | |
| class SettingsTest extends PHPUnit_Framework_TestCase
 | |
| {
 | |
|     /**
 | |
|      * @var string
 | |
|      */
 | |
|     protected $prevValue;
 | |
| 
 | |
|     public function setUp()
 | |
|     {
 | |
|         $this->prevValue = libxml_disable_entity_loader();
 | |
|         libxml_disable_entity_loader(false); // Enable entity loader
 | |
|     }
 | |
| 
 | |
|     protected function tearDown()
 | |
|     {
 | |
|         libxml_disable_entity_loader($this->prevValue);
 | |
|     }
 | |
| 
 | |
|     public function testGetXMLSettings()
 | |
|     {
 | |
|         $result = Settings::getLibXmlLoaderOptions();
 | |
|         self::assertTrue((bool) ((LIBXML_DTDLOAD | LIBXML_DTDATTR) & $result));
 | |
|         self::assertFalse(libxml_disable_entity_loader());
 | |
|     }
 | |
| 
 | |
|     public function testSetXMLSettings()
 | |
|     {
 | |
|         Settings::setLibXmlLoaderOptions(LIBXML_DTDLOAD | LIBXML_DTDATTR | LIBXML_DTDVALID);
 | |
|         $result = Settings::getLibXmlLoaderOptions();
 | |
|         self::assertTrue((bool) ((LIBXML_DTDLOAD | LIBXML_DTDATTR | LIBXML_DTDVALID) & $result));
 | |
|         self::assertFalse(libxml_disable_entity_loader());
 | |
|     }
 | |
| }
 |