diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f23413216..de0cfff6f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -10,7 +10,20 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2'] + php: + - '5.3' + - '5.4' + - '5.5' + - '5.6' + - '7.0' + - '7.1' + - '7.2' + - '7.3' + - '7.4' + - '8.0' + - '8.1' + - '8.2' + - '8.3' name: PHP ${{ matrix.php }} diff --git a/composer.json b/composer.json index 180f341d8..c89b279e1 100644 --- a/composer.json +++ b/composer.json @@ -19,8 +19,8 @@ }, "require-dev": { - "phpunit/php-file-iterator": "^1.4 || ^2.0", - "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5 || ^7.0 || ^8.0" + "phpunit/php-file-iterator": "^1.4 || ^2.0 || ^3.0", + "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5 || ^7.0 || ^8.0 || ^9.0" }, "replace": { diff --git a/tests/Hamcrest/UtilTest.php b/tests/Hamcrest/UtilTest.php index 7248978c7..1fec63eed 100644 --- a/tests/Hamcrest/UtilTest.php +++ b/tests/Hamcrest/UtilTest.php @@ -28,21 +28,28 @@ public function testCheckAllAreMatchersAcceptsMatchers() )); } - /** - * @expectedException InvalidArgumentException - */ public function testCheckAllAreMatchersFailsForPrimitive() { - \Hamcrest\Util::checkAllAreMatchers(array( - new \Hamcrest\Text\MatchesPattern('/fo+/'), - 'foo', - )); + $exceptionThrown = false; + try { + \Hamcrest\Util::checkAllAreMatchers(array( + new \Hamcrest\Text\MatchesPattern('/fo+/'), + 'foo', + )); + } catch (\InvalidArgumentException $exception) { + $exceptionThrown = true; + } + + $this->assertTrue( + $exceptionThrown, + 'Failed asserting that exception of type "InvalidArgumentException" is thrown.' + ); } private function callAndAssertCreateMatcherArray($items) { $matchers = \Hamcrest\Util::createMatcherArray($items); - $this->assertInternalType('array', $matchers); + $this->assertTrue(is_array($matchers), sprintf('Type "array" expected, but got "%s" instead', gettype($matchers))); $this->assertSameSize($items, $matchers); foreach ($matchers as $matcher) { $this->assertInstanceOf('\Hamcrest\Matcher', $matcher);