Skip to content

Commit

Permalink
phpunit/phpunit:^10.5.38, laminas/laminas-coding-standard:^3.0, Apply…
Browse files Browse the repository at this point in the history
… phpunit attribute migration

Signed-off-by: fezfez <[email protected]>

clean

Signed-off-by: fezfez <[email protected]>
  • Loading branch information
fezfez committed Dec 4, 2024
1 parent a9867e4 commit e30480d
Show file tree
Hide file tree
Showing 95 changed files with 1,568 additions and 1,976 deletions.
14 changes: 13 additions & 1 deletion .laminas-ci/phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd" bootstrap="vendor/autoload.php" colors="true">
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="./vendor/autoload.php"
colors="true"
cacheDirectory=".phpunit.cache"
failOnDeprecation="true"
failOnNotice="true"
failOnWarning="true"
failOnPhpunitDeprecation="true"
displayDetailsOnPhpunitDeprecations="true"
displayDetailsOnTestsThatTriggerDeprecations="true"
displayDetailsOnTestsThatTriggerNotices="true"
displayDetailsOnTestsThatTriggerWarnings="true">
<coverage includeUncoveredFiles="true">
<include>
<directory suffix=".php">./src</directory>
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
},
"require-dev": {
"ext-curl": "*",
"laminas/laminas-coding-standard": "~2.4.0",
"phpunit/phpunit": "^9.6.21"
"laminas/laminas-coding-standard": "^3.0.1",
"phpunit/phpunit": "^10.5.38"
},
"suggest": {
"paragonie/certainty": "For automated management of cacert.pem"
Expand Down
692 changes: 291 additions & 401 deletions composer.lock

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,15 @@
<file>src</file>
<file>test</file>
<exclude-pattern>*/_files/*</exclude-pattern>
<exclude-pattern>test/PhpEnvironment/Assets/*</exclude-pattern>

<!-- Include all rules from Laminas Coding Standard -->
<rule ref="LaminasCodingStandard"/>

<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing">
<exclude-pattern>src/</exclude-pattern>
</rule>
<rule ref="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly.ReferenceViaFallbackGlobalName">
<exclude-pattern>src/PhpEnvironment/Response.php</exclude-pattern>
</rule>
</ruleset>
24 changes: 18 additions & 6 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd" bootstrap="vendor/autoload.php" colors="true">
<coverage includeUncoveredFiles="true">
<include>
<directory suffix=".php">./src</directory>
</include>
</coverage>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="./vendor/autoload.php"
colors="true"
cacheDirectory=".phpunit.cache"
failOnDeprecation="true"
failOnNotice="true"
failOnWarning="true"
failOnPhpunitDeprecation="true"
displayDetailsOnPhpunitDeprecations="true"
displayDetailsOnTestsThatTriggerDeprecations="true"
displayDetailsOnTestsThatTriggerNotices="true"
displayDetailsOnTestsThatTriggerWarnings="true">
<testsuites>
<testsuite name="laminas-http Test Suite">
<directory>./test/</directory>
Expand Down Expand Up @@ -39,4 +46,9 @@
<env name="TESTS_LAMINAS_HTTP_CLIENT_HTTP_PROXY_USER" value=""/>
<env name="TESTS_LAMINAS_HTTP_CLIENT_HTTP_PROXY_PASS" value=""/>
</php>
<source>
<include>
<directory suffix=".php">./src</directory>
</include>
</source>
</phpunit>
2 changes: 0 additions & 2 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,6 @@ public function setRawBody($body)
/**
* Set the POST parameters
*
* @param array $post
* @return $this
*/
public function setParameterPost(array $post)
Expand All @@ -500,7 +499,6 @@ public function setParameterPost(array $post)
/**
* Set the GET parameters
*
* @param array $query
* @return $this
*/
public function setParameterGet(array $query)
Expand Down
1 change: 0 additions & 1 deletion src/Client/Adapter/Proxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,6 @@ public function write($method, $uri, $httpVer = '1.1', $headers = [], $body = ''
* @param string $host
* @param int $port
* @param string $httpVer
* @param array $headers
* @throws AdapterException\RuntimeException
*/
protected function connectHandshake($host, $port = 443, $httpVer = '1.1', array &$headers = [])
Expand Down
1 change: 0 additions & 1 deletion src/Header/Accept.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ public function toString()
*
* @param string $type
* @param int|float $priority
* @param array $params
* @return $this
*/
public function addMediaType($type, $priority = 1, array $params = [])
Expand Down
2 changes: 1 addition & 1 deletion src/Header/ContentTransferEncoding.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use function strtolower;

/**
* @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11 @todo find section
* @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11 \@todo find section
*
* @throws Exception\InvalidArgumentException
*/
Expand Down
1 change: 0 additions & 1 deletion src/Header/ContentType.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ public function getMediaType()
/**
* Set additional content-type parameters
*
* @param array $parameters
* @return $this
*/
public function setParameters(array $parameters)
Expand Down
1 change: 0 additions & 1 deletion src/Header/SetCookie.php
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,6 @@ public function toString()
}

/**
* @param array $headers
* @return string
* @throws Exception\RuntimeException
*/
Expand Down
1 change: 0 additions & 1 deletion src/PhpEnvironment/RemoteAddress.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ public function getUseProxy()
/**
* Set list of trusted proxy addresses
*
* @param array $trustedProxies
* @return $this
*/
public function setTrustedProxies(array $trustedProxies)
Expand Down
1 change: 0 additions & 1 deletion src/PhpEnvironment/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

use function call_user_func;
use function header;
use function headers_sent;

/**
* HTTP Response for current PHP environment
Expand Down
15 changes: 6 additions & 9 deletions test/Client/Adapter/CurlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use Laminas\Http\Client\Adapter\Curl;
use Laminas\Uri\Uri;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;

use function curl_getinfo;
Expand All @@ -16,8 +17,7 @@

final class CurlTest extends TestCase
{
/** @var Curl */
private $adapter;
private Curl $adapter;

protected function setUp(): void
{
Expand All @@ -28,7 +28,7 @@ protected function setUp(): void
/**
* @return iterable<non-empty-string,array{0:CURL_HTTP_VERSION_*,1:float}>
*/
public function floatHttpVersions(): iterable
public static function floatHttpVersions(): iterable
{
yield 'HTTP 1.0' => [CURL_HTTP_VERSION_1_0, 1.0];
yield 'HTTP 1.1' => [CURL_HTTP_VERSION_1_1, 1.1];
Expand All @@ -37,7 +37,7 @@ public function floatHttpVersions(): iterable
/**
* @return iterable<non-empty-string,array{0:CURL_HTTP_VERSION_*,1:float}>
*/
public function httpVersions(): iterable
public static function httpVersions(): iterable
{
yield 'HTTP 1.0' => [CURL_HTTP_VERSION_1_0, '1.0'];
yield 'HTTP 1.1' => [CURL_HTTP_VERSION_1_1, '1.1'];
Expand All @@ -46,9 +46,8 @@ public function httpVersions(): iterable
/**
* NOTE: This test is only needed for BC compatibility. The {@see \Laminas\Http\Client\Adapter\AdapterInterface}
* has a default for "string" but "float" was used in {@see Curl::write()} due to the lack of strict types.
*
* @dataProvider floatHttpVersions
*/
#[DataProvider('floatHttpVersions')]
public function testWriteCanHandleFloatHttpVersion(int $expectedCurlOption, float $version): void
{
$this->adapter->connect('example.org');
Expand All @@ -58,9 +57,7 @@ public function testWriteCanHandleFloatHttpVersion(int $expectedCurlOption, floa
self::assertEquals($expectedCurlOption, curl_getinfo($handle, CURLINFO_HTTP_VERSION));
}

/**
* @dataProvider httpVersions
*/
#[DataProvider('httpVersions')]
public function testWriteCanHandleStringHttpVersion(int $expectedCurlOption, string $version): void
{
$this->adapter->connect('example.org');
Expand Down
Loading

0 comments on commit e30480d

Please sign in to comment.