diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2013-04-25 12:02:30 +0200 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2013-04-25 12:03:21 +0200 |
commit | 4ca4b190c831163572491e1afbc42f2799652d76 (patch) | |
tree | c8083f8b6751f5cf110e75f0ab573678af1216dd /tests | |
parent | 01923197d675380404ef9fe0ff3aef743afc65ad (diff) |
import in reversed order because first item is the newest one, #80
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/utility/ImportParserTest.php | 44 |
1 files changed, 32 insertions, 12 deletions
diff --git a/tests/unit/utility/ImportParserTest.php b/tests/unit/utility/ImportParserTest.php index 4014988a4..1a14479fd 100644 --- a/tests/unit/utility/ImportParserTest.php +++ b/tests/unit/utility/ImportParserTest.php @@ -52,15 +52,14 @@ class ImportParserTest extends \OCA\AppFramework\Utility\TestUtility { array( 'id' => "tag:google.com,2005:reader/item/f9fd1dd3c19262e1", 'title' => "[HorribleSubs] Mushibugyo - 01 [720p].mkv", - "published" => 1365415485, - - "alternate" => array( array( - "href" => "http://www.nyaa.eu/?page=view&tid=421561", - "type" => "text/html" - )), - "summary" => array( - "content" => "1596 seeder(s), 775 leecher(s), 8005 download(s) - 316.7 MiB - Trusted" - ) + "published" => 1365415485, + "alternate" => array( array( + "href" => "http://www.nyaa.eu/?page=view&tid=421561", + "type" => "text/html" + )), + "summary" => array( + "content" => "1596 seeder(s), 775 leecher(s), 8005 download(s) - 316.7 MiB - Trusted" + ) ) ) ); @@ -118,9 +117,9 @@ class ImportParserTest extends \OCA\AppFramework\Utility\TestUtility { array( "published" => 1365415485, - "summary" => array( - "content" => "1596 seeder(s), 775 leecher(s), 8005 download(s) - 316.7 MiB - Trusted" - ) + "summary" => array( + "content" => "1596 seeder(s), 775 leecher(s), 8005 download(s) - 316.7 MiB - Trusted" + ) ) ) ); @@ -147,4 +146,25 @@ class ImportParserTest extends \OCA\AppFramework\Utility\TestUtility { $this->assertEquals(array($out), $result); } + + public function testParsesReverse() { + $this->in['items'][1]= array( + 'id' => "tag", + 'title' => "[HorribleSubs] Mushibugyo - 01 [720p].mkv", + "published" => 1365415485, + "alternate" => array( array( + "href" => "http://www.nyaa.eu/?page=view&tid=421561", + "type" => "text/html" + )), + "summary" => array( + "content" => "1596 seeder(s), 775 leecher(s), 8005 download(s) - 316.7 MiB - Trusted" + ) + ); + + $result = $this->parser->parse($this->in); + + $this->assertEquals('tag', $result[0]->getGuid()); + $this->assertEquals('tag:google.com,2005:reader/item/f9fd1dd3c19262e1', + $result[1]->getGuid()); + } } |