Skip to content

Commit

Permalink
Upgrade dev tools; raise PHP requirement to 8.1. (#12)
Browse files Browse the repository at this point in the history
- Removes an obsolete test that is no longer needed due to changes introduced by PHP 8.3.
  • Loading branch information
demiankatz authored Mar 11, 2024
1 parent 399800e commit 6a8283c
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 43 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ jobs:
VUFIND_LOCAL_DIR: $GITHUB_WORKSPACE/local
strategy:
matrix:
php-version: ['8.0', '8.1', '8.2']
php-version: ['8.1', '8.2', '8.3']
include:
- php-version: 8.0
phing_tasks: "phpunitfast"
- php-version: 8.1
phing_tasks: "phpunitfast"
- php-version: 8.2
phing_tasks: "phpunitfast"
- php-version: 8.3
phing_tasks: "phpunitfast phpcs-console php-cs-fixer-dryrun phpstan-console"

steps:
Expand Down
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,28 @@

All notable changes to this project will be documented in this file, in reverse chronological order by release.

## Next Release - TBD

### Added

- Nothing.

### Changed

- The minimum PHP version requirement has been raised to 8.1.

### Deprecated

- Nothing.

### Removed

- Nothing.

## Fixed

- Nothing.

## 1.1.0 - 2024-01-02

### Added
Expand Down
16 changes: 8 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,22 @@
},
"config": {
"platform": {
"php": "8.0"
"php": "8.1"
}
},
"require": {
"php": ">=8.0",
"php": ">=8.1",
"opis/json-schema": "^2.3.0",
"pcrov/jsonreader": "^1.0.2",
"vufind-org/vufindcode": "^1.2"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "3.26.1",
"pear/http_request2": "2.5.1",
"phpmd/phpmd": "2.13.0",
"phpstan/phpstan": "1.10.34",
"phpunit/phpunit": "9.6.12",
"friendsofphp/php-cs-fixer": "3.51.0",
"pear/http_request2": "2.6.0",
"phpmd/phpmd": "2.15.0",
"phpstan/phpstan": "1.10.59",
"phpunit/phpunit": "10.5.11",
"phing/phing": "2.17.4",
"squizlabs/php_codesniffer": "3.7.2"
"squizlabs/php_codesniffer": "3.9.0"
}
}
2 changes: 1 addition & 1 deletion tests/MarcCollectionFileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class MarcCollectionFileTest extends \PHPUnit\Framework\TestCase
*
* @return array
*/
public function collectionFixtures(): array
public static function collectionFixtures(): array
{
return [
['marc/marc_collection.xml'],
Expand Down
2 changes: 1 addition & 1 deletion tests/MarcCollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class MarcCollectionTest extends \PHPUnit\Framework\TestCase
*
* @return array
*/
public function collectionFixtures(): array
public static function collectionFixtures(): array
{
return [
['marc/marc_collection.xml'],
Expand Down
8 changes: 4 additions & 4 deletions tests/MarcLintTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function testCheck020($expected, $input)
*
* @return array
*/
public function get020TestData()
public static function get020TestData()
{
return [
[
Expand Down Expand Up @@ -188,7 +188,7 @@ public function testCheck041($expected, $input)
*
* @return array
*/
public function get041TestData()
public static function get041TestData()
{
return [
[
Expand Down Expand Up @@ -283,7 +283,7 @@ public function testCheck245($expected, $input)
*
* @return array
*/
public function get245TestData()
public static function get245TestData()
{
return [
[
Expand Down Expand Up @@ -604,7 +604,7 @@ public function testCheckArticle($expected, $input)
*
* @return array
*/
public function getCheckArticleTestData()
public static function getCheckArticleTestData()
{
return [
[
Expand Down
17 changes: 0 additions & 17 deletions tests/Serialization/MarcXmlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@

namespace VuFindTest\Marc\Serialization;

use VuFind\Marc\MarcReader;

/**
* MarcXml Test Class
*
Expand Down Expand Up @@ -67,19 +65,4 @@ public function testGetNextRecordWithoutFile()
$class = new \VuFind\Marc\Serialization\MarcXml();
$class->getNextRecord();
}

/**
* Test bad record
*
* @return void
* @throws \Exception
*/
public function testToStringException()
{
$xmlFile = $this->getFixture('marc/bad.mrc');
$reader = new MarcReader($xmlFile);
$this->expectException(\Exception::class);
$this->expectExceptionMessage('Error processing XML');
$xml = $reader->toFormat('MARCXML');
}
}
17 changes: 11 additions & 6 deletions tests/phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
<?xml version="1.0"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="bootstrap.php" backupGlobals="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage includeUncoveredFiles="true">
<include>
<directory suffix=".php">../src</directory>
</include>
</coverage>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
bootstrap="bootstrap.php"
backupGlobals="false"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
displayDetailsOnTestsThatTriggerWarnings="true">
<testsuites>
<testsuite name="AllUnitTests">
<directory>.</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory suffix=".php">../src</directory>
</include>
</source>
</phpunit>
6 changes: 3 additions & 3 deletions tests/vufind.php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
->in(__DIR__ . '/../src');

$rules = [
'@PHP80Migration' => true,
'@PHPUnit84Migration:risky' => true,
'@PHP81Migration' => true,
'@PHPUnit100Migration:risky' => true,
'@PSR12' => true,
'align_multiline_comment' => true,
'binary_operator_spaces' => [
Expand Down Expand Up @@ -44,8 +44,8 @@
'no_php4_constructor' => true,
'no_singleline_whitespace_before_semicolons' => true,
'no_spaces_around_offset' => true,
'no_unneeded_braces' => true,
'no_unneeded_control_parentheses' => true,
'no_unneeded_curly_braces' => true,
'no_unneeded_final_method' => true,
'no_unreachable_default_argument_value' => true,
'no_unused_imports' => true,
Expand Down

0 comments on commit 6a8283c

Please sign in to comment.