Browse Source

Remove XML tests

pull/21/head
Timothy Warren 6 months ago
parent
commit
4c896349b9

+ 0
- 98
tests/API/XMLTest.php View File

@@ -1,98 +0,0 @@
1
-<?php declare(strict_types=1);
2
-/**
3
- * Hummingbird Anime List Client
4
- *
5
- * An API client for Kitsu to manage anime and manga watch lists
6
- *
7
- * PHP version 7.1
8
- *
9
- * @package     HummingbirdAnimeClient
10
- * @author      Timothy J. Warren <tim@timshomepage.net>
11
- * @copyright   2015 - 2018  Timothy J. Warren
12
- * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
13
- * @version     4.1
14
- * @link        https://git.timshomepage.net/timw4mail/HummingBirdAnimeClient
15
- */
16
-
17
-namespace Aviat\AnimeClient\Tests\API;
18
-
19
-use Aviat\AnimeClient\API\XML;
20
-use PHPUnit\Framework\TestCase;
21
-
22
-class XMLTest extends TestCase {
23
-	
24
-	protected $malExport;
25
-	protected $xml;
26
-	protected $expectedXml;
27
-	protected $object;
28
-	protected $array;
29
-
30
-	public function setUp()
31
-	{
32
-		$this->malExport = file_get_contents(__DIR__ . '/../test_data/XML/MALExport.xml');
33
-		$this->xml = file_get_contents(__DIR__ . '/../test_data/XML/xmlTestFile.xml');
34
-		$this->expectedXml = file_get_contents(__DIR__ . '/../test_data/XML/minifiedXmlTestFile.xml');
35
-
36
-		$this->array = [
37
-			'entry' => [
38
-				'foo' => [
39
-					'bar' => [
40
-						'baz' => 42
41
-					]
42
-				],
43
-				'episode' => '11',
44
-				'status' => 'watching',
45
-				'score' => '7',
46
-				'storage_type' => '1',
47
-				'storage_value' => '2.5',
48
-				'times_rewatched' => '1',
49
-				'rewatch_value' => '3',
50
-				'date_start' => '01152015',
51
-				'date_finish' => '10232016',
52
-				'priority' => '2',
53
-				'enable_discussion' => '0',
54
-				'enable_rewatching' => '1',
55
-				'comments' => 'Should you say something?',
56
-				'tags' => 'test tag, 2nd tag'
57
-			]
58
-		];
59
-
60
-		$this->object = new XML();
61
-	}
62
-
63
-	public function testToArray()
64
-	{
65
-		$this->assertEquals($this->array, XML::toArray($this->xml));
66
-	}
67
-	
68
-	public function testMALExport()
69
-	{
70
-		$array = XML::toArray($this->malExport);
71
-		$this->assertEquals($array['myanimelist']['myinfo']['user_total_anime'], count($array['myanimelist']['anime']));
72
-		// $this->assertEquals($array, XML::toArray($this->malExport));
73
-	}
74
-
75
-	public function testParse()
76
-	{
77
-		$this->object->setXML($this->xml);
78
-		$this->assertEquals($this->array, $this->object->parse());
79
-	}
80
-
81
-	public function testToXML()
82
-	{
83
-		$this->assertEquals($this->expectedXml, XML::toXML($this->array));
84
-	}
85
-
86
-	public function testCreateXML()
87
-	{
88
-		$this->object->setData($this->array);
89
-		$this->assertEquals($this->expectedXml, $this->object->createXML());
90
-	}
91
-
92
-	public function testToString()
93
-	{
94
-		$this->object->setData($this->array);
95
-		$this->assertEquals($this->expectedXml, $this->object->__toString());
96
-		$this->assertEquals($this->expectedXml, (string) $this->object);
97
-	}
98
-}

+ 0
- 14491
tests/test_data/XML/MALExport.xml
File diff suppressed because it is too large
View File


+ 0
- 2
tests/test_data/XML/minifiedXmlTestFile.xml View File

@@ -1,2 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<entry><foo><bar><baz>42</baz></bar></foo><episode>11</episode><status>watching</status><score>7</score><storage_type>1</storage_type><storage_value>2.5</storage_value><times_rewatched>1</times_rewatched><rewatch_value>3</rewatch_value><date_start>01152015</date_start><date_finish>10232016</date_finish><priority>2</priority><enable_discussion>0</enable_discussion><enable_rewatching>1</enable_rewatching><comments>Should you say something?</comments><tags>test tag, 2nd tag</tags></entry>

+ 0
- 22
tests/test_data/XML/xmlTestFile.xml View File

@@ -1,22 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<entry>
3
-	<foo>
4
-		<bar>
5
-			<baz>42</baz>
6
-		</bar>
7
-	</foo>
8
-	<episode>11</episode>
9
-	<status>watching</status>
10
-	<score>7</score>
11
-	<storage_type>1</storage_type>
12
-	<storage_value>2.5</storage_value>
13
-	<times_rewatched>1</times_rewatched>
14
-	<rewatch_value>3</rewatch_value>
15
-	<date_start>01152015</date_start>
16
-	<date_finish>10232016</date_finish>
17
-	<priority>2</priority>
18
-	<enable_discussion>0</enable_discussion>
19
-	<enable_rewatching>1</enable_rewatching>
20
-	<comments>Should you say something?</comments>
21
-	<tags>test tag, 2nd tag</tags>
22
-</entry>

Loading…
Cancel
Save