Skip to content

update deps to phpunit 6.x, fix code and tests #100

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 20, 2017
Merged
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
9 changes: 2 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,9 @@ cache:

matrix:
include:
- php: 5.3
env: DEPENDENCIES='low'
- php: 5.3
- php: 5.4
- php: 5.5
- php: 5.6
- php: 7.0
- php: hhvm
env: DEPENDENCIES='low'
- php: 7.1

before_install:
- composer self-update
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}
],
"require": {
"php": ">=5.3.0",
"php": ">=7.0.0",
"ext-filter": "*",
"coduo/php-to-string": "^2",
"symfony/property-access": "^2.3|^3.0",
Expand All @@ -24,7 +24,7 @@
"openlss/lib-array2xml": "~0.0.9"
},
"require-dev": {
"phpunit/phpunit": "^4.8"
"phpunit/phpunit": "^6.0"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<testsuite name="PHP Matcher Test Suite">
<directory>./tests/</directory>
<exclude>tests/PHPUnit/PHPMatcherAssertionsTest.php</exclude>
<file phpVersion="5.4.0" phpVersionOperator=">=">tests/PHPUnit/PHPMatcherAssertionsTest.php</file>
<file phpVersion="7.0.0" phpVersionOperator=">=">tests/PHPUnit/PHPMatcherAssertionsTest.php</file>
</testsuite>
</testsuites>
<filter>
Expand Down
4 changes: 2 additions & 2 deletions src/PHPUnit/PHPMatcherAssertions.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ trait PHPMatcherAssertions
*/
protected function assertMatchesPattern($pattern, $value, $message = '')
{
\PHPUnit_Framework_TestCase::assertThat($value, self::matchesPattern($pattern), $message);
\PHPUnit\Framework\TestCase::assertThat($value, self::matchesPattern($pattern), $message);
}

/**
Expand All @@ -23,4 +23,4 @@ protected static function matchesPattern($pattern)
{
return new PHPMatcherConstraint($pattern);
}
}
}
4 changes: 2 additions & 2 deletions src/PHPUnit/PHPMatcherConstraint.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Coduo\PHPMatcher\Factory\SimpleFactory;
use Coduo\PHPMatcher\Matcher;

final class PHPMatcherConstraint extends \PHPUnit_Framework_Constraint
final class PHPMatcherConstraint extends \PHPUnit\Framework\Constraint\Constraint
{
/**
* @var string
Expand Down Expand Up @@ -65,4 +65,4 @@ private function createMatcher()

return $factory->createMatcher();
}
}
}
4 changes: 2 additions & 2 deletions src/PHPUnit/PHPMatcherTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Coduo\PHPMatcher\PHPUnit;

abstract class PHPMatcherTestCase extends \PHPUnit_Framework_TestCase
abstract class PHPMatcherTestCase extends \PHPUnit\Framework\TestCase
{
/**
* @param string $pattern
Expand All @@ -23,4 +23,4 @@ protected static function matchesPattern($pattern)
{
return new PHPMatcherConstraint($pattern);
}
}
}
2 changes: 1 addition & 1 deletion tests/Factory/SimpleFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use Coduo\PHPMatcher\Matcher;
use Coduo\PHPMatcher\Factory\SimpleFactory;

class SimpleFactoryTest extends \PHPUnit_Framework_TestCase
class SimpleFactoryTest extends \PHPUnit\Framework\TestCase
{
public function test_creating_matcher()
{
Expand Down
2 changes: 1 addition & 1 deletion tests/LexerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Coduo\PHPMatcher\Lexer;

class LexerTest extends \PHPUnit_Framework_TestCase
class LexerTest extends \PHPUnit\Framework\TestCase
{
/**
* @dataProvider validStringValuesProvider
Expand Down
2 changes: 1 addition & 1 deletion tests/Matcher/ArrayMatcherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Coduo\PHPMatcher\Matcher;
use Coduo\PHPMatcher\Parser;

class ArrayMatcherTest extends \PHPUnit_Framework_TestCase
class ArrayMatcherTest extends \PHPUnit\Framework\TestCase
{
/**
* @var Matcher\ArrayMatcher
Expand Down
2 changes: 1 addition & 1 deletion tests/Matcher/BooleanMatcherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

use Coduo\PHPMatcher\Matcher\BooleanMatcher;

class BooleanMatcherTest extends \PHPUnit_Framework_TestCase
class BooleanMatcherTest extends \PHPUnit\Framework\TestCase
{
/**
* @dataProvider positiveCanMatchData
Expand Down
2 changes: 1 addition & 1 deletion tests/Matcher/CallbackMatcherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

use Coduo\PHPMatcher\Matcher\CallbackMatcher;

class CallbackMatcherTest extends \PHPUnit_Framework_TestCase
class CallbackMatcherTest extends \PHPUnit\Framework\TestCase
{
function test_positive_can_match()
{
Expand Down
6 changes: 3 additions & 3 deletions tests/Matcher/ChainMatcherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use Coduo\PHPMatcher\Matcher\ArrayMatcher;
use Coduo\PHPMatcher\Matcher\ChainMatcher;

class ChainMatcherTest extends \PHPUnit_Framework_TestCase
class ChainMatcherTest extends \PHPUnit\Framework\TestCase
{
/**
* @var ArrayMatcher
Expand All @@ -23,8 +23,8 @@ class ChainMatcherTest extends \PHPUnit_Framework_TestCase

public function setUp()
{
$this->firstMatcher = $this->getMock('Coduo\PHPMatcher\Matcher\ValueMatcher');
$this->secondMatcher = $this->getMock('Coduo\PHPMatcher\Matcher\ValueMatcher');
$this->firstMatcher = $this->createMock('Coduo\PHPMatcher\Matcher\ValueMatcher');
$this->secondMatcher = $this->createMock('Coduo\PHPMatcher\Matcher\ValueMatcher');

$this->matcher = new ChainMatcher(array(
$this->firstMatcher,
Expand Down
2 changes: 1 addition & 1 deletion tests/Matcher/DoubleMatcherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Coduo\PHPMatcher\Matcher\DoubleMatcher;
use Coduo\PHPMatcher\Parser;

class DoubleMatcherTest extends \PHPUnit_Framework_TestCase
class DoubleMatcherTest extends \PHPUnit\Framework\TestCase
{
/**
* @var DoubleMatcher
Expand Down
2 changes: 1 addition & 1 deletion tests/Matcher/ExpressionMatcherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

use Coduo\PHPMatcher\Matcher\ExpressionMatcher;

class ExpressionMatcherTest extends \PHPUnit_Framework_TestCase
class ExpressionMatcherTest extends \PHPUnit\Framework\TestCase
{
/**
* @dataProvider positiveCanMatchData
Expand Down
2 changes: 1 addition & 1 deletion tests/Matcher/IntegerMatcherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Coduo\PHPMatcher\Matcher\IntegerMatcher;
use Coduo\PHPMatcher\Parser;

class IntegerMatcherTest extends \PHPUnit_Framework_TestCase
class IntegerMatcherTest extends \PHPUnit\Framework\TestCase
{
/**
* @var IntegerMatcher
Expand Down
2 changes: 1 addition & 1 deletion tests/Matcher/JsonMatcherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Coduo\PHPMatcher\Matcher;
use Coduo\PHPMatcher\Parser;

class JsonMatcherTest extends \PHPUnit_Framework_TestCase
class JsonMatcherTest extends \PHPUnit\Framework\TestCase
{
/**
* @var Matcher\JsonMatcher
Expand Down
2 changes: 1 addition & 1 deletion tests/Matcher/NullMatcherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

use Coduo\PHPMatcher\Matcher\NullMatcher;

class NullMatcherTest extends \PHPUnit_Framework_TestCase
class NullMatcherTest extends \PHPUnit\Framework\TestCase
{
/**
* @dataProvider positiveCanMatchData
Expand Down
2 changes: 1 addition & 1 deletion tests/Matcher/NumberMatcherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

use Coduo\PHPMatcher\Matcher\NumberMatcher;

class NumberMatcherTest extends \PHPUnit_Framework_TestCase
class NumberMatcherTest extends \PHPUnit\Framework\TestCase
{
/**
* @dataProvider positiveCanMatchData
Expand Down
2 changes: 1 addition & 1 deletion tests/Matcher/OrMatcherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Coduo\PHPMatcher\Matcher;
use Coduo\PHPMatcher\Parser;

class OrMatcherTest extends \PHPUnit_Framework_TestCase
class OrMatcherTest extends \PHPUnit\Framework\TestCase
{
/**
* @var Matcher\OrMatcher
Expand Down
2 changes: 1 addition & 1 deletion tests/Matcher/Pattern/Expander/ContainsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Coduo\PHPMatcher\Matcher;
use Coduo\PHPMatcher\Matcher\Pattern\Expander\Contains;

class ContainsTest extends \PHPUnit_Framework_TestCase
class ContainsTest extends \PHPUnit\Framework\TestCase
{
/**
* @dataProvider examplesIgnoreCaseProvider
Expand Down
2 changes: 1 addition & 1 deletion tests/Matcher/Pattern/Expander/CountTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Coduo\PHPMatcher\Matcher;
use Coduo\PHPMatcher\Matcher\Pattern\Expander\Count;

class CountTest extends \PHPUnit_Framework_TestCase
class CountTest extends \PHPUnit\Framework\TestCase
{
/**
* @dataProvider examplesProvider
Expand Down
2 changes: 1 addition & 1 deletion tests/Matcher/Pattern/Expander/EndsWithTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Coduo\PHPMatcher\Matcher;
use Coduo\PHPMatcher\Matcher\Pattern\Expander\EndsWith;

class EndsWithTest extends \PHPUnit_Framework_TestCase
class EndsWithTest extends \PHPUnit\Framework\TestCase
{
/**
* @dataProvider notIgnoringCaseExamplesProvider
Expand Down
2 changes: 1 addition & 1 deletion tests/Matcher/Pattern/Expander/GreaterThanTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Coduo\PHPMatcher\Matcher;
use Coduo\PHPMatcher\Matcher\Pattern\Expander\GreaterThan;

class GreaterThanTest extends \PHPUnit_Framework_TestCase
class GreaterThanTest extends \PHPUnit\Framework\TestCase
{
/**
* @dataProvider examplesProvider
Expand Down
2 changes: 1 addition & 1 deletion tests/Matcher/Pattern/Expander/InArrayTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Coduo\PHPMatcher\Matcher;
use Coduo\PHPMatcher\Matcher\Pattern\Expander\InArray;

class InArrayTest extends \PHPUnit_Framework_TestCase
class InArrayTest extends \PHPUnit\Framework\TestCase
{
/**
* @dataProvider examplesProvider
Expand Down
2 changes: 1 addition & 1 deletion tests/Matcher/Pattern/Expander/IsDateTimeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Coduo\PHPMatcher\Matcher;
use Coduo\PHPMatcher\Matcher\Pattern\Expander\IsDateTime;

class IsDateTimeTest extends \PHPUnit_Framework_TestCase
class IsDateTimeTest extends \PHPUnit\Framework\TestCase
{
/**
* @dataProvider examplesDatesProvider
Expand Down
2 changes: 1 addition & 1 deletion tests/Matcher/Pattern/Expander/IsEmailTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Coduo\PHPMatcher\Matcher;
use Coduo\PHPMatcher\Matcher\Pattern\Expander\IsEmail;

class IsEmailTest extends \PHPUnit_Framework_TestCase
class IsEmailTest extends \PHPUnit\Framework\TestCase
{
/**
* @dataProvider examplesEmailsProvider
Expand Down
2 changes: 1 addition & 1 deletion tests/Matcher/Pattern/Expander/IsEmptyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/**
* @author Benjamin Lazarecki <[email protected]>
*/
class IsEmptyTest extends \PHPUnit_Framework_TestCase
class IsEmptyTest extends \PHPUnit\Framework\TestCase
{
/**
* @dataProvider examplesProvider
Expand Down
2 changes: 1 addition & 1 deletion tests/Matcher/Pattern/Expander/IsNotEmptyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Coduo\PHPMatcher\Matcher;
use Coduo\PHPMatcher\Matcher\Pattern\Expander\IsNotEmpty;

class IsNotEmptyTest extends \PHPUnit_Framework_TestCase
class IsNotEmptyTest extends \PHPUnit\Framework\TestCase
{
/**
* @dataProvider examplesProvider
Expand Down
2 changes: 1 addition & 1 deletion tests/Matcher/Pattern/Expander/IsUrlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Coduo\PHPMatcher\Matcher;
use Coduo\PHPMatcher\Matcher\Pattern\Expander\IsUrl;

class IsUrlTest extends \PHPUnit_Framework_TestCase
class IsUrlTest extends \PHPUnit\Framework\TestCase
{
/**
* @dataProvider examplesUrlsProvider
Expand Down
2 changes: 1 addition & 1 deletion tests/Matcher/Pattern/Expander/LowerThanTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Coduo\PHPMatcher\Matcher;
use Coduo\PHPMatcher\Matcher\Pattern\Expander\LowerThan;

class LowerThanTest extends \PHPUnit_Framework_TestCase
class LowerThanTest extends \PHPUnit\Framework\TestCase
{
/**
* @dataProvider examplesProvider
Expand Down
2 changes: 1 addition & 1 deletion tests/Matcher/Pattern/Expander/MatchRegexTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/**
* @author Benjamin Lazarecki <[email protected]>
*/
class MatchRegexTest extends \PHPUnit_Framework_TestCase
class MatchRegexTest extends \PHPUnit\Framework\TestCase
{
/**
* @dataProvider examplesProvider
Expand Down
2 changes: 1 addition & 1 deletion tests/Matcher/Pattern/Expander/OneOfTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Coduo\PHPMatcher\Matcher\Pattern\Expander\Contains;
use Coduo\PHPMatcher\Matcher\Pattern\Expander\OneOf;

class OneOfTest extends \PHPUnit_Framework_TestCase
class OneOfTest extends \PHPUnit\Framework\TestCase
{
/**
* @expectedException \InvalidArgumentException
Expand Down
2 changes: 1 addition & 1 deletion tests/Matcher/Pattern/Expander/StartsWithTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Coduo\PHPMatcher\Matcher;
use Coduo\PHPMatcher\Matcher\Pattern\Expander\StartsWith;

class StartsWithTest extends \PHPUnit_Framework_TestCase
class StartsWithTest extends \PHPUnit\Framework\TestCase
{
/**
* @dataProvider notIgnoringCaseExamplesProvider
Expand Down
2 changes: 1 addition & 1 deletion tests/Matcher/Pattern/RegexConverterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Coduo\PHPMatcher\Matcher\Pattern\TypePattern;
use Coduo\PHPMatcher\Matcher\Pattern\RegexConverter;

class RegexConverterTest extends \PHPUnit_Framework_TestCase
class RegexConverterTest extends \PHPUnit\Framework\TestCase
{
/**
* @var RegexConverter
Expand Down
2 changes: 1 addition & 1 deletion tests/Matcher/ScalarMatcherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

use Coduo\PHPMatcher\Matcher\ScalarMatcher;

class ScalarMatcherTest extends \PHPUnit_Framework_TestCase
class ScalarMatcherTest extends \PHPUnit\Framework\TestCase
{
/**
* @dataProvider positiveCanMatches
Expand Down
2 changes: 1 addition & 1 deletion tests/Matcher/StringMatcherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Coduo\PHPMatcher\Matcher\StringMatcher;
use Coduo\PHPMatcher\Parser;

class StringMatcherTest extends \PHPUnit_Framework_TestCase
class StringMatcherTest extends \PHPUnit\Framework\TestCase
{
/**
* @var StringMatcher
Expand Down
2 changes: 1 addition & 1 deletion tests/Matcher/TextMatcherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Coduo\PHPMatcher\Matcher;
use Coduo\PHPMatcher\Parser;

class TextMatcherTest extends \PHPUnit_Framework_TestCase
class TextMatcherTest extends \PHPUnit\Framework\TestCase
{
/**
* @var Matcher\TextMatcher
Expand Down
2 changes: 1 addition & 1 deletion tests/Matcher/UuidMatcherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Coduo\PHPMatcher\Matcher\UuidMatcher;

class UuidMatcherTest extends \PHPUnit_Framework_TestCase
class UuidMatcherTest extends \PHPUnit\Framework\TestCase
{
/**
* @var UuidMatcher
Expand Down
2 changes: 1 addition & 1 deletion tests/Matcher/WildcardMatcherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

use Coduo\PHPMatcher\Matcher\WildcardMatcher;

class WildcardMatcherTest extends \PHPUnit_Framework_TestCase
class WildcardMatcherTest extends \PHPUnit\Framework\TestCase
{

/**
Expand Down
Loading