forked from OpenMage/magento-lts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Converted line ending of some files in order to avoid warnings from g…
…it (OpenMage#3368)
- Loading branch information
Showing
159 changed files
with
89,128 additions
and
89,128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,52 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace OpenMage\Tests\Unit\Base; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
|
||
class XmlFileLoadingTest extends TestCase | ||
{ | ||
|
||
public function provideXmlFiles(): array | ||
{ | ||
$root = realpath(__DIR__ . '/../../../../') . '/'; | ||
|
||
$result = []; | ||
$result[] = [ | ||
$root . 'vendor/shardj/zf1-future/library/Zend/Locale/Data/es_419.xml' | ||
]; | ||
|
||
return $result; | ||
} | ||
|
||
/** | ||
* | ||
* @dataProvider provideXmlFiles | ||
* @param $filepath | ||
* @return void | ||
*/ | ||
public function testFileLoading($filepath): void | ||
{ | ||
//$simplexml = new \SimpleXMLElement(file_get_contents($filepath)); | ||
$simplexml = simplexml_load_file( | ||
$filepath, | ||
null, | ||
LIBXML_PEDANTIC //not needed by OpenMage, but good to test more strictly | ||
); | ||
$this->assertNotEmpty($simplexml->asXML()); | ||
} | ||
|
||
/** | ||
* | ||
* @dataProvider provideXmlFiles | ||
* @param $filepath | ||
* @return void | ||
*/ | ||
public function testXmlReaderIsValid($filepath): void | ||
{ | ||
$xml = \XMLReader::open($filepath); | ||
$xml->setParserProperty(\XMLReader::VALIDATE, true); | ||
$this->assertTrue($xml->isValid()); | ||
} | ||
} | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace OpenMage\Tests\Unit\Base; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
|
||
class XmlFileLoadingTest extends TestCase | ||
{ | ||
|
||
public function provideXmlFiles(): array | ||
{ | ||
$root = realpath(__DIR__ . '/../../../../') . '/'; | ||
|
||
$result = []; | ||
$result[] = [ | ||
$root . 'vendor/shardj/zf1-future/library/Zend/Locale/Data/es_419.xml' | ||
]; | ||
|
||
return $result; | ||
} | ||
|
||
/** | ||
* | ||
* @dataProvider provideXmlFiles | ||
* @param $filepath | ||
* @return void | ||
*/ | ||
public function testFileLoading($filepath): void | ||
{ | ||
//$simplexml = new \SimpleXMLElement(file_get_contents($filepath)); | ||
$simplexml = simplexml_load_file( | ||
$filepath, | ||
null, | ||
LIBXML_PEDANTIC //not needed by OpenMage, but good to test more strictly | ||
); | ||
$this->assertNotEmpty($simplexml->asXML()); | ||
} | ||
|
||
/** | ||
* | ||
* @dataProvider provideXmlFiles | ||
* @param $filepath | ||
* @return void | ||
*/ | ||
public function testXmlReaderIsValid($filepath): void | ||
{ | ||
$xml = \XMLReader::open($filepath); | ||
$xml->setParserProperty(\XMLReader::VALIDATE, true); | ||
$this->assertTrue($xml->isValid()); | ||
} | ||
} |
Oops, something went wrong.