mirror of
https://github.com/e107inc/e107.git
synced 2025-04-07 06:03:25 +02:00
Eliminated Internet dependency from xmlClassTest
This commit is contained in:
parent
b0ae4b6e3d
commit
55bd50aac0
2
e107
2
e107
@ -1 +1 @@
|
||||
Subproject commit 3976b9b4bd8920d9ea59ca34da35927a62d0c761
|
||||
Subproject commit 08f7a5d76691fe0460f18abeab581897ae56defa
|
@ -9,6 +9,42 @@
|
||||
|
||||
class xmlClassTest extends \Codeception\Test\Unit
|
||||
{
|
||||
const RAW_XML = '<?xml version="1.0" encoding="UTF-8"?>
|
||||
<feed xmlns:yt="http://www.youtube.com/xml/schemas/2015" xmlns:media="http://search.yahoo.com/mrss/" xmlns="http://www.w3.org/2005/Atom">
|
||||
<link rel="self" href="http://www.youtube.com/feeds/videos.xml?channel_id=UC7vv3cBq14FRXajteZt6FEg"/>
|
||||
<id>yt:channel:UC7vv3cBq14FRXajteZt6FEg</id>
|
||||
<yt:channelId>UC7vv3cBq14FRXajteZt6FEg</yt:channelId>
|
||||
<title>egucom2014</title>
|
||||
<link rel="alternate" href="https://www.youtube.com/channel/UC7vv3cBq14FRXajteZt6FEg"/>
|
||||
<author>
|
||||
<name>egucom2014</name>
|
||||
<uri>https://www.youtube.com/channel/UC7vv3cBq14FRXajteZt6FEg</uri>
|
||||
</author>
|
||||
<published>2016-01-17T11:31:33+00:00</published>
|
||||
<entry>
|
||||
<id>yt:video:palm1QdV8ZI</id>
|
||||
<yt:videoId>palm1QdV8ZI</yt:videoId>
|
||||
<yt:channelId>UC7vv3cBq14FRXajteZt6FEg</yt:channelId>
|
||||
<title>[EGU] Erstes Offizielles Intro</title>
|
||||
<link rel="alternate" href="https://www.youtube.com/watch?v=palm1QdV8ZI"/>
|
||||
<author>
|
||||
<name>egucom2014</name>
|
||||
<uri>https://www.youtube.com/channel/UC7vv3cBq14FRXajteZt6FEg</uri>
|
||||
</author>
|
||||
<published>2017-09-30T18:44:07+00:00</published>
|
||||
<updated>2019-01-18T20:11:48+00:00</updated>
|
||||
<media:group>
|
||||
<media:title>[EGU] Erstes Offizielles Intro</media:title>
|
||||
<media:content url="https://www.youtube.com/v/palm1QdV8ZI?version=3" type="application/x-shockwave-flash" width="640" height="390"/>
|
||||
<media:thumbnail url="https://i1.ytimg.com/vi/palm1QdV8ZI/hqdefault.jpg" width="480" height="360"/>
|
||||
<media:description>Das erste Intro von Eternal GamerZ United!</media:description>
|
||||
<media:community>
|
||||
<media:starRating count="3" average="3.67" min="1" max="5"/>
|
||||
<media:statistics views="71"/>
|
||||
</media:community>
|
||||
</media:group>
|
||||
</entry>
|
||||
</feed>';
|
||||
/** @var xmlClass */
|
||||
private $_xml;
|
||||
|
||||
@ -16,7 +52,16 @@
|
||||
{
|
||||
try
|
||||
{
|
||||
$this->_xml = $this->make('xmlClass');
|
||||
$this->_xml = $this->make('xmlClass',
|
||||
[
|
||||
'getRemoteFile' => function($address, $timeout = 10, $postData = null)
|
||||
{
|
||||
$this->_xml->xmlFileContents = self::RAW_XML;
|
||||
return self::RAW_XML;
|
||||
},
|
||||
'xmlFileContents' => self::RAW_XML
|
||||
]
|
||||
);
|
||||
// $this->_xml->__construct();
|
||||
}
|
||||
catch (Exception $e)
|
||||
@ -54,42 +99,7 @@
|
||||
*/
|
||||
public function testParseXml()
|
||||
{
|
||||
$raw = '<?xml version="1.0" encoding="UTF-8"?>
|
||||
<feed xmlns:yt="http://www.youtube.com/xml/schemas/2015" xmlns:media="http://search.yahoo.com/mrss/" xmlns="http://www.w3.org/2005/Atom">
|
||||
<link rel="self" href="http://www.youtube.com/feeds/videos.xml?channel_id=UC7vv3cBq14FRXajteZt6FEg"/>
|
||||
<id>yt:channel:UC7vv3cBq14FRXajteZt6FEg</id>
|
||||
<yt:channelId>UC7vv3cBq14FRXajteZt6FEg</yt:channelId>
|
||||
<title>egucom2014</title>
|
||||
<link rel="alternate" href="https://www.youtube.com/channel/UC7vv3cBq14FRXajteZt6FEg"/>
|
||||
<author>
|
||||
<name>egucom2014</name>
|
||||
<uri>https://www.youtube.com/channel/UC7vv3cBq14FRXajteZt6FEg</uri>
|
||||
</author>
|
||||
<published>2016-01-17T11:31:33+00:00</published>
|
||||
<entry>
|
||||
<id>yt:video:palm1QdV8ZI</id>
|
||||
<yt:videoId>palm1QdV8ZI</yt:videoId>
|
||||
<yt:channelId>UC7vv3cBq14FRXajteZt6FEg</yt:channelId>
|
||||
<title>[EGU] Erstes Offizielles Intro</title>
|
||||
<link rel="alternate" href="https://www.youtube.com/watch?v=palm1QdV8ZI"/>
|
||||
<author>
|
||||
<name>egucom2014</name>
|
||||
<uri>https://www.youtube.com/channel/UC7vv3cBq14FRXajteZt6FEg</uri>
|
||||
</author>
|
||||
<published>2017-09-30T18:44:07+00:00</published>
|
||||
<updated>2019-01-18T20:11:48+00:00</updated>
|
||||
<media:group>
|
||||
<media:title>[EGU] Erstes Offizielles Intro</media:title>
|
||||
<media:content url="https://www.youtube.com/v/palm1QdV8ZI?version=3" type="application/x-shockwave-flash" width="640" height="390"/>
|
||||
<media:thumbnail url="https://i1.ytimg.com/vi/palm1QdV8ZI/hqdefault.jpg" width="480" height="360"/>
|
||||
<media:description>Das erste Intro von Eternal GamerZ United!</media:description>
|
||||
<media:community>
|
||||
<media:starRating count="3" average="3.67" min="1" max="5"/>
|
||||
<media:statistics views="71"/>
|
||||
</media:community>
|
||||
</media:group>
|
||||
</entry>
|
||||
</feed>';
|
||||
$raw = self::RAW_XML;
|
||||
|
||||
$result = $this->_xml->parseXml($raw,true);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user