Skip to content

Commit

Permalink
Update dependencies and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaasuni committed Feb 12, 2017
1 parent 476b2a3 commit 1025362
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 27 deletions.
7 changes: 4 additions & 3 deletions .travis.yml
Expand Up @@ -16,6 +16,7 @@ php:
- 5.5
- 5.6
- 7.0
- 7.1
- hhvm
- nightly

Expand All @@ -40,7 +41,7 @@ before_install:

before_script:
- composer install --no-interaction
- if [ "$TRAVIS_PHP_VERSION" = "5.6" ]; then composer require satooshi/php-coveralls:dev-master --no-interaction; fi
- if [ "$TRAVIS_PHP_VERSION" = "7.0" ]; then composer require satooshi/php-coveralls:dev-master --no-interaction; fi

script:
- make qa_all
Expand All @@ -55,5 +56,5 @@ after_success:
- cat ./target/report/phpcompatinfo.txt
- "echo 'coverage_clover: target/coverage/coverage.xml' >> .coveralls.yml"
- "echo 'json_path: target/coverage/coveralls-upload.json' >> .coveralls.yml"
- if [ "$TRAVIS_PHP_VERSION" = "5.6" ]; then php vendor/bin/coveralls -v; fi;
- if [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PHP_VERSION" = "5.6" ] && [ -n "$BT_APIUSER" ]; then make bintray APIUSER=${BT_APIUSER} APIKEY=${BT_APIKEY}; fi;
- if [ "$TRAVIS_PHP_VERSION" = "7.0" ]; then php vendor/bin/coveralls -v; fi;
- if [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PHP_VERSION" = "7.0" ] && [ -n "$BT_APIUSER" ]; then make bintray APIUSER=${BT_APIUSER} APIKEY=${BT_APIKEY}; fi;
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
1.3.4
1.3.5
14 changes: 7 additions & 7 deletions composer.json
Expand Up @@ -19,13 +19,13 @@
},
"require-dev": {
"apigen/apigen" : "^4.1.2",
"bartlett/php-compatinfo" : "^5.0.0",
"pdepend/pdepend" : "^2.2.2",
"phploc/phploc" : "^2.1.5|^3.0.0",
"phpmd/phpmd" : "^2.3.2",
"phpunit/phpunit": "4.8.19|^5.0.0",
"sebastian/phpcpd" : "^2.0.2",
"squizlabs/php_codesniffer": "^2.5.0|^3.0.0"
"bartlett/php-compatinfo" : "^5.0.4",
"pdepend/pdepend" : "^2.5.0",
"phploc/phploc" : "^2.1.5 || ^3.0.1",
"phpmd/phpmd" : "^2.6.0",
"phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0",
"sebastian/phpcpd" : "^2.0.4 || 3.0.0",
"squizlabs/php_codesniffer": "^2.8.0 || ^3.0.0"
},
"autoload": {
"psr-4":{
Expand Down
63 changes: 47 additions & 16 deletions test/FilterTest.php
Expand Up @@ -15,6 +15,8 @@

namespace Test;

use PHPUnit\Framework\TestCase;

/**
* Filter Test
*
Expand All @@ -26,7 +28,7 @@
* @license http://www.gnu.org/copyleft/lesser.html GNU-LGPL v3 (see LICENSE.TXT)
* @link https://github.com/tecnickcom/tc-lib-pdf-filter
*/
class FilterTest extends \PHPUnit_Framework_TestCase
class FilterTest extends TestCase
{
protected $obj = null;

Expand All @@ -42,9 +44,11 @@ public function testEmptyFilter()
$this->assertEquals('tc-lib-pdf-filter', $result);
}

/**
* @expectedException \Com\Tecnick\Pdf\Filter\Exception
*/
public function testUnknownFilter()
{
$this->setExpectedException('\Com\Tecnick\Pdf\Filter\Exception');
$this->obj->decode('Unknown', 'YZ');
}

Expand All @@ -61,15 +65,22 @@ public function testAsciiHex()
$code = '30 31 32 33 34 35 36 37 38 39 9>';
$result = $this->obj->decode('ASCIIHexDecode', $code);
$this->assertEquals("0123456789\t", $result);
}

$this->setExpectedException('\Com\Tecnick\Pdf\Filter\Exception');
/**
* @expectedException \Com\Tecnick\Pdf\Filter\Exception
*/
public function testAsciiHexEx()
{
$code = '30 31 32 33 34 35 36 37 38 39 9';
$this->obj->decode('ASCIIHexDecode', $code);
}

/**
* @expectedException \Com\Tecnick\Pdf\Filter\Exception
*/
public function testAsciiHexException()
{
$this->setExpectedException('\Com\Tecnick\Pdf\Filter\Exception');
$this->obj->decode('ASCIIHexDecode', 'YZ 34 HJ>');
}

Expand All @@ -78,8 +89,13 @@ public function testAsciiEightFive()
$code = '<~FCQn=BjrZ5A7dE*Bl%m&EW~>';
$result = $this->obj->decode('ASCII85Decode', $code);
$this->assertEquals('tc-lib-pdf-filter', $result);
}

$this->setExpectedException('\Com\Tecnick\Pdf\Filter\Exception');
/**
* @expectedException \Com\Tecnick\Pdf\Filter\Exception
*/
public function testAsciiEightFiveEx()
{
$this->obj->decode('ASCII85Decode', chr(254));
}

Expand All @@ -88,8 +104,13 @@ public function testFlate()
$code ="\x78\x9c\x2b\x49\xd6\xcd\xc9\x4c\xd2\x2d\x48\x49\xd3\x4d\xcb\xcc\x29\x49\x2d\x2\x0\x37\x64\x6\x56";
$result = $this->obj->decode('FlateDecode', $code);
$this->assertEquals('tc-lib-pdf-filter', $result);
}

$this->setExpectedException('\Com\Tecnick\Pdf\Filter\Exception');
/**
* @expectedException \Com\Tecnick\Pdf\Filter\Exception
*/
public function testFlateEx()
{
$this->obj->decode('FlateDecode', 'ABC');
}

Expand All @@ -99,34 +120,44 @@ public function testRunLength()
$result = $this->obj->decode('RunLengthDecode', $code);
$this->assertEquals('AAAAAAAAAA tc-lib-pdf-filter BBBBBBBBBB', $result);
}


/**
* @expectedException \Com\Tecnick\Pdf\Filter\Exception
*/
public function testCcittFax()
{
$this->setExpectedException('\Com\Tecnick\Pdf\Filter\Exception');
$this->obj->decode('CCITTFaxDecode', '');
}


/**
* @expectedException \Com\Tecnick\Pdf\Filter\Exception
*/
public function testJbigTwo()
{
$this->setExpectedException('\Com\Tecnick\Pdf\Filter\Exception');
$this->obj->decode('JBIG2Decode', '');
}


/**
* @expectedException \Com\Tecnick\Pdf\Filter\Exception
*/
public function testDct()
{
$this->setExpectedException('\Com\Tecnick\Pdf\Filter\Exception');
$this->obj->decode('DCTDecode', '');
}


/**
* @expectedException \Com\Tecnick\Pdf\Filter\Exception
*/
public function testJpx()
{
$this->setExpectedException('\Com\Tecnick\Pdf\Filter\Exception');
$this->obj->decode('JPXDecode', '');
}


/**
* @expectedException \Com\Tecnick\Pdf\Filter\Exception
*/
public function testCrypt()
{
$this->setExpectedException('\Com\Tecnick\Pdf\Filter\Exception');
$this->obj->decode('Crypt', '');
}

Expand Down

0 comments on commit 1025362

Please sign in to comment.