1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
class Site_Model_test extends TestCase { |
4
|
|
|
private $Sites_Model; |
5
|
|
|
|
6
|
|
|
public function setUp() { |
7
|
|
|
$this->resetInstance(); |
|
|
|
|
8
|
|
|
|
9
|
|
|
$this->Sites_Model = new Sites_Model(); |
10
|
|
|
} |
11
|
|
|
|
12
|
|
|
//TODO: Each test should check a randomized series each time instead of using the same series. |
13
|
|
|
|
14
|
|
View Code Duplication |
public function test_MangaFox() { |
|
|
|
|
15
|
|
|
$result = $this->Sites_Model->{'MangaFox'}->getTitleData('tsugumomo'); |
16
|
|
|
|
17
|
|
|
$this->assertInternalType('array', $result); |
|
|
|
|
18
|
|
|
$this->assertArrayHasKey('title', $result); |
|
|
|
|
19
|
|
|
$this->assertArrayHasKey('latest_chapter', $result); |
|
|
|
|
20
|
|
|
$this->assertArrayHasKey('last_updated', $result); |
|
|
|
|
21
|
|
|
|
22
|
|
|
$this->assertEquals('Tsugumomo', $result['title']); |
|
|
|
|
23
|
|
|
$this->assertRegExp('/^[c|v][0-9\.]+(?:\/c[0-9\.]+)?$/', $result['latest_chapter']); |
|
|
|
|
24
|
|
|
$this->assertRegExp('/^[0-9]+-[0-9]+-[0-9]+ [0-9]+:[0-9]+:[0-9]+$/', $result['last_updated']); |
|
|
|
|
25
|
|
|
} |
26
|
|
|
|
27
|
|
View Code Duplication |
public function test_MangaHere() { |
|
|
|
|
28
|
|
|
$result = $this->Sites_Model->{'MangaHere'}->getTitleData('tsugumomo'); |
29
|
|
|
|
30
|
|
|
$this->assertInternalType('array', $result); |
|
|
|
|
31
|
|
|
$this->assertArrayHasKey('title', $result); |
|
|
|
|
32
|
|
|
$this->assertArrayHasKey('latest_chapter', $result); |
|
|
|
|
33
|
|
|
$this->assertArrayHasKey('last_updated', $result); |
|
|
|
|
34
|
|
|
|
35
|
|
|
$this->assertEquals('Tsugumomo', $result['title']); |
|
|
|
|
36
|
|
|
$this->assertRegExp('/^[c|v][0-9\.]+(?:\/c[0-9\.]+)?$/', $result['latest_chapter']); |
|
|
|
|
37
|
|
|
$this->assertRegExp('/^[0-9]+-[0-9]+-[0-9]+ [0-9]+:[0-9]+:[0-9]+$/', $result['last_updated']); |
|
|
|
|
38
|
|
|
} |
39
|
|
|
|
40
|
|
View Code Duplication |
public function test_Batoto() { |
|
|
|
|
41
|
|
|
$this->skipTravis('Missing required cookies.'); |
|
|
|
|
42
|
|
|
|
43
|
|
|
$result = $this->Sites_Model->{'Batoto'}->getTitleData('tsugumomo-r4271:--:English'); |
44
|
|
|
|
45
|
|
|
$this->assertInternalType('array', $result); |
|
|
|
|
46
|
|
|
$this->assertArrayHasKey('title', $result); |
|
|
|
|
47
|
|
|
$this->assertArrayHasKey('latest_chapter', $result); |
|
|
|
|
48
|
|
|
$this->assertArrayHasKey('last_updated', $result); |
|
|
|
|
49
|
|
|
|
50
|
|
|
$this->assertEquals('Tsugumomo', $result['title']); |
|
|
|
|
51
|
|
|
$this->assertRegExp('/^[a-zA-Z0-9]+:--:[c|v][0-9\.]+(?:\/c[0-9\.]+)?$/', $result['latest_chapter']); |
|
|
|
|
52
|
|
|
$this->assertRegExp('/^[0-9]+-[0-9]+-[0-9]+ [0-9]+:[0-9]+:[0-9]+$/', $result['last_updated']); |
|
|
|
|
53
|
|
|
} |
54
|
|
View Code Duplication |
public function test_DynastyScans() { |
|
|
|
|
55
|
|
|
$result = $this->Sites_Model->{'DynastyScans'}->getTitleData('qualia_the_purple:--:0'); |
56
|
|
|
|
57
|
|
|
$this->assertInternalType('array', $result); |
|
|
|
|
58
|
|
|
$this->assertArrayHasKey('title', $result); |
|
|
|
|
59
|
|
|
$this->assertArrayHasKey('latest_chapter', $result); |
|
|
|
|
60
|
|
|
$this->assertArrayHasKey('last_updated', $result); |
|
|
|
|
61
|
|
|
|
62
|
|
|
$this->assertEquals('Qualia the Purple', $result['title']); |
|
|
|
|
63
|
|
|
$this->assertRegExp('/^ch(?:apters)?[0-9]+(?:_[0-9]+)?$/', $result['latest_chapter']); |
|
|
|
|
64
|
|
|
$this->assertRegExp('/^[0-9]+-[0-9]+-[0-9]+ [0-9]+:[0-9]+:[0-9]+$/', $result['last_updated']); |
|
|
|
|
65
|
|
|
} |
66
|
|
View Code Duplication |
public function test_MangaPanda() { |
|
|
|
|
67
|
|
|
$result = $this->Sites_Model->{'MangaPanda'}->getTitleData('relife'); |
68
|
|
|
|
69
|
|
|
$this->assertInternalType('array', $result); |
|
|
|
|
70
|
|
|
$this->assertArrayHasKey('title', $result); |
|
|
|
|
71
|
|
|
$this->assertArrayHasKey('latest_chapter', $result); |
|
|
|
|
72
|
|
|
$this->assertArrayHasKey('last_updated', $result); |
|
|
|
|
73
|
|
|
|
74
|
|
|
$this->assertEquals('ReLIFE', $result['title']); |
|
|
|
|
75
|
|
|
$this->assertRegExp('/^[0-9]+$/', $result['latest_chapter']); |
|
|
|
|
76
|
|
|
$this->assertRegExp('/^[0-9]+-[0-9]+-[0-9]+ [0-9]+:[0-9]+:[0-9]+$/', $result['last_updated']); |
|
|
|
|
77
|
|
|
} |
78
|
|
View Code Duplication |
public function test_MangaStream() { |
|
|
|
|
79
|
|
|
$this->skipTravis('Travis\'s PHP Curl ver. doesn\'t seem to play nice with SSL.'); |
|
|
|
|
80
|
|
|
|
81
|
|
|
$result = $this->Sites_Model->{'MangaStream'}->getTitleData('okitegami'); |
82
|
|
|
|
83
|
|
|
$this->assertInternalType('array', $result); |
|
|
|
|
84
|
|
|
$this->assertArrayHasKey('title', $result); |
|
|
|
|
85
|
|
|
$this->assertArrayHasKey('latest_chapter', $result); |
|
|
|
|
86
|
|
|
$this->assertArrayHasKey('last_updated', $result); |
|
|
|
|
87
|
|
|
|
88
|
|
|
$this->assertEquals('The Memorandum of Kyoko Okitegami', $result['title']); |
|
|
|
|
89
|
|
|
$this->assertRegExp('/^[0-9]+\/[0-9]+$/', $result['latest_chapter']); |
|
|
|
|
90
|
|
|
$this->assertRegExp('/^[0-9]+-[0-9]+-[0-9]+ [0-9]+:[0-9]+:[0-9]+$/', $result['last_updated']); |
|
|
|
|
91
|
|
|
} |
92
|
|
View Code Duplication |
public function test_WebToons() { |
|
|
|
|
93
|
|
|
$result = $this->Sites_Model->{'WebToons'}->getTitleData('93:--:en:--:girls-of-the-wilds:--:action'); |
94
|
|
|
|
95
|
|
|
$this->assertInternalType('array', $result); |
|
|
|
|
96
|
|
|
$this->assertArrayHasKey('title', $result); |
|
|
|
|
97
|
|
|
$this->assertArrayHasKey('latest_chapter', $result); |
|
|
|
|
98
|
|
|
$this->assertArrayHasKey('last_updated', $result); |
|
|
|
|
99
|
|
|
|
100
|
|
|
$this->assertEquals('Girls of the Wild\'s', $result['title']); |
|
|
|
|
101
|
|
|
$this->assertRegExp('/^.*?$/', $result['latest_chapter']); |
|
|
|
|
102
|
|
|
$this->assertRegExp('/^[0-9]+-[0-9]+-[0-9]+ [0-9]+:[0-9]+:[0-9]+$/', $result['last_updated']); |
|
|
|
|
103
|
|
|
} |
104
|
|
|
public function test_KissManga() { |
105
|
|
|
$this->markTestSkipped('KM is not supported for the time being'); |
|
|
|
|
106
|
|
|
|
107
|
|
|
//$this->skipTravis('Missing required cookies.'); |
108
|
|
|
// |
109
|
|
|
//$result = $this->Sites_Model->{'KissManga'}->getTitleData('Tsugumomo'); |
110
|
|
|
// |
111
|
|
|
//$this->assertInternalType('array', $result); |
112
|
|
|
//$this->assertArrayHasKey('title', $result); |
113
|
|
|
//$this->assertArrayHasKey('latest_chapter', $result); |
114
|
|
|
//$this->assertArrayHasKey('last_updated', $result); |
115
|
|
|
// |
116
|
|
|
//$this->assertEquals('Tsugumomo', $result['title']); |
117
|
|
|
//$this->assertRegExp('/^.*?:--:[0-9]+$/', $result['latest_chapter']); |
118
|
|
|
//$this->assertRegExp('/^[0-9]+-[0-9]+-[0-9]+ [0-9]+:[0-9]+:[0-9]+$/', $result['last_updated']); |
119
|
|
|
} |
120
|
|
View Code Duplication |
public function test_KireiCake() { |
|
|
|
|
121
|
|
|
$result = $this->Sites_Model->{'KireiCake'}->getTitleData('helck'); |
122
|
|
|
|
123
|
|
|
$this->assertInternalType('array', $result); |
|
|
|
|
124
|
|
|
$this->assertArrayHasKey('title', $result); |
|
|
|
|
125
|
|
|
$this->assertArrayHasKey('latest_chapter', $result); |
|
|
|
|
126
|
|
|
$this->assertArrayHasKey('last_updated', $result); |
|
|
|
|
127
|
|
|
|
128
|
|
|
$this->assertEquals('helck', $result['title']); |
|
|
|
|
129
|
|
|
$this->assertRegExp('/^[a-z]+\/[0-9]+\/[0-9]+(?:\/[0-9]+)?$/', $result['latest_chapter']); |
|
|
|
|
130
|
|
|
$this->assertRegExp('/^[0-9]+-[0-9]+-[0-9]+ [0-9]+:[0-9]+:[0-9]+$/', $result['last_updated']); |
|
|
|
|
131
|
|
|
} |
132
|
|
View Code Duplication |
public function test_GameOfScanlation() { |
|
|
|
|
133
|
|
|
$result = $this->Sites_Model->{'GameOfScanlation'}->getTitleData('legendary-moonlight-sculptor.99'); |
134
|
|
|
|
135
|
|
|
$this->assertInternalType('array', $result); |
|
|
|
|
136
|
|
|
$this->assertArrayHasKey('title', $result); |
|
|
|
|
137
|
|
|
$this->assertArrayHasKey('latest_chapter', $result); |
|
|
|
|
138
|
|
|
$this->assertArrayHasKey('last_updated', $result); |
|
|
|
|
139
|
|
|
|
140
|
|
|
$this->assertEquals('Legendary Moonlight Sculptor', $result['title']); |
|
|
|
|
141
|
|
|
$this->assertRegExp('/^[a-z0-9\.-]+$/', $result['latest_chapter']); |
|
|
|
|
142
|
|
|
$this->assertRegExp('/^[0-9]+-[0-9]+-[0-9]+ [0-9]+:[0-9]+:[0-9]+$/', $result['last_updated']); |
|
|
|
|
143
|
|
|
} |
144
|
|
|
} |
145
|
|
|
|
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.