Skip to content

Commit

Permalink
chore: drop PHP 5.x, PHPUnit 5.x and PHPUnit polyfill (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
keradus committed Nov 25, 2023
1 parent 9742206 commit b1f1ea9
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 41 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ jobs:
fail-fast: false
matrix:
include:
- php-version: '5.6'
composer-flags: '--prefer-stable --prefer-lowest'
- php-version: '7.0'
composer-flags: '--prefer-stable --prefer-lowest'
- php-version: '7.1'
- php-version: '7.2'
- php-version: '7.3'
Expand Down
5 changes: 2 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@
}
],
"require": {
"php": "^5.5 || ^7.0 || ^8.0",
"php": "^7.0 || ^8.0",
"ext-dom": "*",
"ext-libxml": "*",
"phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.0 || ^9.0 || ^10.0",
"phpunitgoodpractices/polyfill": "^1.4"
"phpunit/phpunit": "^6.5.14 || ^7.5.20 || ^8.0 || ^9.0 || ^10.0"
},
"autoload": {
"psr-4": {
Expand Down
12 changes: 1 addition & 11 deletions src/Constraint/XmlMatchesXsdForV5.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,11 @@ public function __construct($xsd)
$this->xsd = $xsd;
}

/**
* {@inheritdoc}
*/
public function toString()
{
return 'matches XSD';
}

/**
* {@inheritdoc}
*/
protected function failureDescription($other)
{
if (\is_string($other)) {
Expand All @@ -79,15 +73,11 @@ protected function failureDescription($other)
return $type.' '.$this->toString();
}

/**
* {@inheritdoc}
*/
protected function matches($other)
{
return \is_string($other)
? $this->stringMatches($other)
: false
;
: false;
}

/**
Expand Down
12 changes: 1 addition & 11 deletions src/Constraint/XmlMatchesXsdForV7.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,11 @@ public function __construct($xsd)
$this->xsd = $xsd;
}

/**
* {@inheritdoc}
*/
public function toString(): string
{
return 'matches XSD';
}

/**
* {@inheritdoc}
*/
protected function failureDescription($other): string
{
if (\is_string($other)) {
Expand All @@ -75,15 +69,11 @@ protected function failureDescription($other): string
return $type.' '.$this->toString();
}

/**
* {@inheritdoc}
*/
protected function matches($other): bool
{
return \is_string($other)
? $this->stringMatches($other)
: false
;
: false;
}

/**
Expand Down
12 changes: 1 addition & 11 deletions src/Constraint/XmlMatchesXsdForV8.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,11 @@ public function __construct($xsd)
$this->xsd = $xsd;
}

/**
* {@inheritdoc}
*/
public function toString(): string
{
return 'matches XSD';
}

/**
* {@inheritdoc}
*/
protected function failureDescription($other): string
{
if (\is_string($other)) {
Expand All @@ -73,15 +67,11 @@ protected function failureDescription($other): string
return $type.' '.$this->toString();
}

/**
* {@inheritdoc}
*/
protected function matches($other): bool
{
return \is_string($other)
? $this->stringMatches($other)
: false
;
: false;
}

/**
Expand Down
6 changes: 3 additions & 3 deletions tests/Constraint/XmlMatchesXsdTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ public function testAssertXMLMatchesXSD()
}

$constraint->evaluate($content); // should not throw an exception
static::assertTrue($constraint->evaluate($content, '', true));
self::assertTrue($constraint->evaluate($content, '', true));
}

public function testXMLValidConstraintBasics()
{
$constraint = new XmlMatchesXsd('');
static::assertSame(1, $constraint->count());
static::assertSame('matches XSD', $constraint->toString());
self::assertSame(1, $constraint->count());
self::assertSame('matches XSD', $constraint->toString());
}

public function testXMLValidConstraintFalse()
Expand Down

0 comments on commit b1f1ea9

Please sign in to comment.