Skip to content
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

Upgrade dev tools; raise PHP requirement to 8.1; fix deprecation warning. #27

Merged
merged 2 commits into from
Mar 11, 2024
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
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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ All notable changes to this project will be documented in this file, in reverse

### Changed

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

### Deprecated

Expand Down
16 changes: 8 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@
},
"config": {
"platform": {
"php": "8.0"
"php": "8.1"
}
},
"require": {
"php": ">=8.0",
"php": ">=8.1",
"laminas/laminas-http": ">=2.2"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "3.26.1",
"friendsofphp/php-cs-fixer": "3.51.0",
"laminas/laminas-uri": ">=2.2",
"pear/http_request2": "2.5.1",
"phpmd/phpmd": "2.13.0",
"phpstan/phpstan": "1.10.34",
"phpunit/phpunit": "9.6.12",
"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"
},
"autoload": {
"psr-0": {
Expand Down
22 changes: 12 additions & 10 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="tests/bootstrap.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage includeUncoveredFiles="true">
<include>
<directory suffix=".php">src</directory>
</include>
</coverage>
<?xml version="1.0"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
backupGlobals="false"
bootstrap="tests/bootstrap.php"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
displayDetailsOnTestsThatTriggerWarnings="true">
<testsuites>
<testsuite name="Unit Tests">
<directory>tests/unit-tests</directory>
</testsuite>
</testsuites>
<php>
<includePath>.</includePath>
</php>
<source>
<include>
<directory suffix=".php">src</directory>
</include>
</source>
</phpunit>
2 changes: 1 addition & 1 deletion src/VuFindHttp/HttpService.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ public function post(
$client->setRawBody($body);
$client->setHeaders(
array_merge(
['Content-Type' => $type, 'Content-Length' => strlen($body)],
['Content-Type' => $type, 'Content-Length' => strlen($body ?? '')],
$headers
)
);
Expand Down
16 changes: 8 additions & 8 deletions tests/unit-tests/src/VuFindTest/HttpServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
* @link https://vufind.org/wiki/development
*/
class ProxyServiceTest extends \PHPUnit\Framework\TestCase
class HttpServiceTest extends \PHPUnit\Framework\TestCase
{
/**
* Example representations of localhost.
Expand All @@ -84,7 +84,7 @@ public function testGetWithAssocParams()
{
$service = new Service();
$adapter = $this->getMockBuilder('Laminas\Http\Client\Adapter\Test')
->setMethods(['write'])->getMock();
->onlyMethods(['write'])->getMock();
$adapter->expects($this->once())
->method('write')
->with(
Expand All @@ -106,7 +106,7 @@ public function testGetWithParamPairs()
{
$service = new Service();
$adapter = $this->getMockBuilder('Laminas\Http\Client\Adapter\Test')
->setMethods(['write'])->getMock();
->onlyMethods(['write'])->getMock();
$adapter->expects($this->once())
->method('write')
->with(
Expand All @@ -128,7 +128,7 @@ public function testGetAppendsQueryPart()
{
$service = new Service();
$adapter = $this->getMockBuilder('Laminas\Http\Client\Adapter\Test')
->setMethods(['write'])->getMock();
->onlyMethods(['write'])->getMock();
$adapter->expects($this->once())
->method('write')
->with(
Expand All @@ -150,7 +150,7 @@ public function testGetAppendsHeaders()
{
$service = new Service();
$adapter = $this->getMockBuilder('Laminas\Http\Client\Adapter\Test')
->setMethods(['write'])->getMock();
->onlyMethods(['write'])->getMock();
$adapter->expects($this->once())
->method('write')
->with(
Expand Down Expand Up @@ -185,7 +185,7 @@ public function testPostAppendsHeaders()
{
$service = new Service();
$adapter = $this->getMockBuilder('Laminas\Http\Client\Adapter\Test')
->setMethods(['write'])->getMock();
->onlyMethods(['write'])->getMock();
$adapter->expects($this->once())
->method('write')
->with(
Expand Down Expand Up @@ -215,7 +215,7 @@ public function testPostForm()
{
$service = new Service();
$adapter = $this->getMockBuilder('Laminas\Http\Client\Adapter\Test')
->setMethods(['write'])->getMock();
->onlyMethods(['write'])->getMock();
$adapter->expects($this->once())
->method('write')
->with(
Expand All @@ -237,7 +237,7 @@ public function testSendPostRequestEmptyBody()
{
$service = new Service();
$adapter = $this->getMockBuilder('Laminas\Http\Client\Adapter\Test')
->setMethods(['write'])->getMock();
->onlyMethods(['write'])->getMock();
$adapter->expects($this->once())
->method('write')
->with(
Expand Down
Loading