From 55bd50aac0aae8054a9a3a581a9531c5cd27ba93 Mon Sep 17 00:00:00 2001 From: Deltik Date: Fri, 8 Feb 2019 15:39:34 -0600 Subject: [PATCH] Eliminated Internet dependency from xmlClassTest --- e107 | 2 +- tests/unit/xmlClassTest.php | 84 +++++++++++++++++++++---------------- 2 files changed, 48 insertions(+), 38 deletions(-) diff --git a/e107 b/e107 index 3976b9b4b..08f7a5d76 160000 --- a/e107 +++ b/e107 @@ -1 +1 @@ -Subproject commit 3976b9b4bd8920d9ea59ca34da35927a62d0c761 +Subproject commit 08f7a5d76691fe0460f18abeab581897ae56defa diff --git a/tests/unit/xmlClassTest.php b/tests/unit/xmlClassTest.php index e69c8c8c6..9e1a9b366 100644 --- a/tests/unit/xmlClassTest.php +++ b/tests/unit/xmlClassTest.php @@ -9,6 +9,42 @@ class xmlClassTest extends \Codeception\Test\Unit { + const RAW_XML = ' + + + yt:channel:UC7vv3cBq14FRXajteZt6FEg + UC7vv3cBq14FRXajteZt6FEg + egucom2014 + + + egucom2014 + https://www.youtube.com/channel/UC7vv3cBq14FRXajteZt6FEg + + 2016-01-17T11:31:33+00:00 + + yt:video:palm1QdV8ZI + palm1QdV8ZI + UC7vv3cBq14FRXajteZt6FEg + [EGU] Erstes Offizielles Intro + + + egucom2014 + https://www.youtube.com/channel/UC7vv3cBq14FRXajteZt6FEg + + 2017-09-30T18:44:07+00:00 + 2019-01-18T20:11:48+00:00 + + [EGU] Erstes Offizielles Intro + + + Das erste Intro von Eternal GamerZ United! + + + + + + + '; /** @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 = ' - - - yt:channel:UC7vv3cBq14FRXajteZt6FEg - UC7vv3cBq14FRXajteZt6FEg - egucom2014 - - - egucom2014 - https://www.youtube.com/channel/UC7vv3cBq14FRXajteZt6FEg - - 2016-01-17T11:31:33+00:00 - - yt:video:palm1QdV8ZI - palm1QdV8ZI - UC7vv3cBq14FRXajteZt6FEg - [EGU] Erstes Offizielles Intro - - - egucom2014 - https://www.youtube.com/channel/UC7vv3cBq14FRXajteZt6FEg - - 2017-09-30T18:44:07+00:00 - 2019-01-18T20:11:48+00:00 - - [EGU] Erstes Offizielles Intro - - - Das erste Intro von Eternal GamerZ United! - - - - - - - '; + $raw = self::RAW_XML; $result = $this->_xml->parseXml($raw,true);