Skip to content

Commit 10b4ec3

Browse files
committed
fix some tests and better coverage
1 parent ca1f903 commit 10b4ec3

File tree

3 files changed

+46
-1
lines changed

3 files changed

+46
-1
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
/tests/output
55
/composer.phar
66
coverage.xml
7+
coverage.html/

tests/exceptionTest.php

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?php
2+
require_once __DIR__ . '/../vendor/autoload.php';
3+
4+
class exceptionTest extends PHPUnit_Framework_TestCase
5+
{
6+
7+
public function testGetJsonFromConsoleException()
8+
{
9+
try {
10+
\czPechy\Claymore\Parser::getJsonFromConsole( '' );
11+
} catch (\czPechy\Claymore\ParserException $pe) {
12+
$this->throwException($pe);
13+
}
14+
}
15+
16+
public function testGetSharesFromConsoleException()
17+
{
18+
try {
19+
\czPechy\Claymore\Parser::getSharesFromConsole( '' );
20+
} catch (\czPechy\Claymore\ParserException $pe) {
21+
$this->throwException($pe);
22+
}
23+
}
24+
25+
public function testGetGPUsFromConsoleException()
26+
{
27+
try {
28+
\czPechy\Claymore\Parser::getGPUsFromConsole( '' );
29+
} catch (\czPechy\Claymore\ParserException $pe) {
30+
$this->throwException($pe);
31+
}
32+
}
33+
34+
public function testDownloadDataException()
35+
{
36+
try {
37+
$client = new \czPechy\Claymore\Client('http://some-bad-ip:3333');
38+
$client->getJson();
39+
} catch (\czPechy\Claymore\ClientException $ce) {
40+
$this->throwException($ce);
41+
}
42+
}
43+
44+
}

tests/jsonTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
require_once __DIR__ . '/../vendor/autoload.php';
33

4-
class json extends PHPUnit_Framework_TestCase
4+
class jsonTest extends PHPUnit_Framework_TestCase
55
{
66

77
public function testParse()

0 commit comments

Comments
 (0)