Skip to content

Commit

Permalink
Drop PHP versions before 7.2 (#232)
Browse files Browse the repository at this point in the history
* Drop PHP versions before 7.2

* Remove derprecaed phpunit code

* Fixes according to review

* Typo
  • Loading branch information
Nyholm committed Jan 18, 2021
1 parent bb3cf2e commit 1838a0f
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 56 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,6 @@ jobs:
strategy:
matrix:
php-version:
- "5.3"
- "5.4"
- "5.5"
- "5.6"
- "7.0"
- "7.1"
- "7.2"
- "7.3"
- "7.4"
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
}
],
"require": {
"php": "^5.3.3 || ^7.0 || ^8.0",
"php": "^7.2 || ^8.0",
"symfony/polyfill-ctype": "^1.8"
},
"conflict": {
"phpstan/phpstan": "<0.12.20",
"vimeo/psalm": "<3.9.1"
},
"require-dev": {
"phpunit/phpunit": "^4.8.36 || ^7.5.13 || ^8.5.13"
"phpunit/phpunit": "^8.5.13"
},
"extra": {
"branch-alias": {
Expand Down
18 changes: 10 additions & 8 deletions tests/AssertTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use Error;
use Exception;
use LogicException;
use PHPUnit\Framework\TestCase;
use RuntimeException;
use stdClass;
use Webmozart\Assert\Assert;
Expand All @@ -25,7 +26,7 @@
*
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class AssertTest extends BaseTestCase
class AssertTest extends TestCase
{
private static $resource;

Expand Down Expand Up @@ -422,7 +423,7 @@ public function getTests()
// no tests for readable()/writable() for now
array('classExists', array(__CLASS__), true),
array('classExists', array(__NAMESPACE__.'\Foobar'), false),
array('subclassOf', array(__CLASS__, 'Webmozart\Assert\Tests\BaseTestCase'), true),
array('subclassOf', array(__CLASS__, 'PHPUnit\Framework\TestCase'), true),
array('subclassOf', array(__CLASS__, 'stdClass'), false),
array('interfaceExists', array('\Countable'), true),
array('interfaceExists', array(__CLASS__), false),
Expand Down Expand Up @@ -598,7 +599,7 @@ public function testAssert($method, $args, $success, $multibyte = false, $minVer
}

if (!$success) {
$this->setExpectedException('\InvalidArgumentException');
$this->expectException('\InvalidArgumentException');
}

call_user_func_array(array('Webmozart\Assert\Assert', $method), $args);
Expand All @@ -620,7 +621,7 @@ public function testNullOr($method, $args, $success, $multibyte = false, $minVer
}

if (!$success && null !== reset($args)) {
$this->setExpectedException('\InvalidArgumentException');
$this->expectException('\InvalidArgumentException');
}

call_user_func_array(array('Webmozart\Assert\Assert', 'nullOr'.ucfirst($method)), $args);
Expand Down Expand Up @@ -651,7 +652,7 @@ public function testAllArray($method, $args, $success, $multibyte = false, $minV
}

if (!$success) {
$this->setExpectedException('\InvalidArgumentException');
$this->expectException('\InvalidArgumentException');
}

$arg = array_shift($args);
Expand All @@ -676,7 +677,7 @@ public function testAllTraversable($method, $args, $success, $multibyte = false,
}

if (!$success) {
$this->setExpectedException('\InvalidArgumentException');
$this->expectException('\InvalidArgumentException');
}

$arg = array_shift($args);
Expand Down Expand Up @@ -716,14 +717,15 @@ public function getStringConversions()
*/
public function testConvertValuesToStrings($method, $args, $exceptionMessage)
{
$this->setExpectedException('\InvalidArgumentException', $exceptionMessage);
$this->expectException('\InvalidArgumentException', $exceptionMessage);
$this->expectExceptionMessage($exceptionMessage);

call_user_func_array(array('Webmozart\Assert\Assert', $method), $args);
}

public function testAnUnknownMethodThrowsABadMethodCall()
{
$this->setExpectedException('\BadMethodCallException');
$this->expectException('\BadMethodCallException');

Assert::nonExistentMethod();
}
Expand Down
38 changes: 0 additions & 38 deletions tests/BaseTestCase.php

This file was deleted.

5 changes: 3 additions & 2 deletions tests/ProjectCodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

namespace Webmozart\Assert\Tests;

use PHPUnit\Framework\TestCase;
use ReflectionClass;
use ReflectionMethod;
use Webmozart\Assert\Bin\MixinGenerator;

/**
* @coversNothing
*/
class ProjectCodeTest extends BaseTestCase
class ProjectCodeTest extends TestCase
{
private static $readmeContent;
private static $assertDocComment;
Expand Down Expand Up @@ -119,7 +120,7 @@ public function testHasThrowsAnnotation($method)
)
);

$this->assertContains(
$this->assertStringContainsString(
'@throws InvalidArgumentException',
$doc,
sprintf(
Expand Down

0 comments on commit 1838a0f

Please sign in to comment.