Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"ext-SPL": "*"
},
"require-dev": {
"phpunit/phpunit": ">=4.8",
"phpunit/phpunit": ">6.0",
"codeclimate/php-test-reporter": "dev-master",
"satooshi/php-coveralls": "~1.0"
},
Expand All @@ -28,5 +28,8 @@
"psr-0": {
"CrEOF\\Geo\\WKB\\Tests": "tests/"
}
},
"scripts": {
"test": "phpunit -v"
}
}
2 changes: 1 addition & 1 deletion lib/CrEOF/Geo/WKB/Reader.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ private function getByteOrder()
/**
* @param string $format
*
* @return array
* @return int
* @throws RangeException
*/
private function unpackInput($format)
Expand Down
24 changes: 9 additions & 15 deletions tests/CrEOF/Geo/WKB/Tests/ParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
namespace CrEOF\Geo\WKB\Tests;

use CrEOF\Geo\WKB\Parser;
use PHPUnit\Framework\TestCase;


/**
* Parser tests
Expand All @@ -33,31 +35,23 @@
*
* @covers \CrEOF\Geo\WKB\Parser
*/
class ParserTest extends \PHPUnit_Framework_TestCase
class ParserTest extends TestCase
{
/**
* @param mixed $value
* @param mixed $value
* @param string $exception
* @param string $message
*
* @dataProvider badBinaryData
*/
public function testBadBinaryData($value, $exception, $message)
public function testBadBinaryData($value, string $exception, string $message)
{
if (version_compare(\PHPUnit_Runner_Version::id(), '5.0', '>=')) {
$this->expectException($exception);
$this->expectException($exception);

if ('/' === $message[0]) {
$this->expectExceptionMessageRegExp($message);
} else {
$this->expectExceptionMessage($message);
}
if ('/' === $message[0]) {
$this->expectExceptionMessageMatches($message);
} else {
if ('/' === $message[0]) {
$this->setExpectedExceptionRegExp($exception, $message);
} else {
$this->setExpectedException($exception, $message);
}
$this->expectExceptionMessage($message);
}

$parser = new Parser($value);
Expand Down
25 changes: 9 additions & 16 deletions tests/CrEOF/Geo/WKB/Tests/ReaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
namespace CrEOF\Geo\WKB\Tests;

use CrEOF\Geo\WKB\Reader;
use PHPUnit\Framework\TestCase;

/**
* Reader tests
Expand All @@ -33,32 +34,24 @@
*
* @covers \CrEOF\Geo\WKB\Reader
*/
class ReaderTest extends \PHPUnit_Framework_TestCase
class ReaderTest extends TestCase
{
/**
* @param mixed $value
* @param array $methods
* @param mixed $value
* @param array $methods
* @param string $exception
* @param string $message
*
* @dataProvider badTestData
*/
public function testBad($value, array $methods, $exception, $message)
public function testBad($value, array $methods, string $exception, string $message)
{
if (version_compare(\PHPUnit_Runner_Version::id(), '5.0', '>=')) {
$this->expectException($exception);
$this->expectException($exception);

if ('/' === $message[0]) {
$this->expectExceptionMessageRegExp($message);
} else {
$this->expectExceptionMessage($message);
}
if ('/' === $message[0]) {
$this->expectExceptionMessageMatches($message);
} else {
if ('/' === $message[0]) {
$this->setExpectedExceptionRegExp($exception, $message);
} else {
$this->setExpectedException($exception, $message);
}
$this->expectExceptionMessage($message);
}

$reader = new Reader($value);
Expand Down