Page MenuHomeDevCentral

D3528.diff
No OneTemporary

D3528.diff

diff --git a/composer.json b/composer.json
--- a/composer.json
+++ b/composer.json
@@ -26,7 +26,8 @@
"php": ">=5.6.0"
},
"require-dev": {
- "phpunit/phpunit": "5.0.*"
+ "php": ">=8.2.0",
+ "phpunit/phpunit": "11.*"
},
"autoload": {
"psr-4": {
diff --git a/tests/XHubSignatureTest.php b/tests/XHubSignatureTest.php
--- a/tests/XHubSignatureTest.php
+++ b/tests/XHubSignatureTest.php
@@ -1,14 +1,16 @@
-<?php
+<?php declare(strict_types=1);
+
+use PHPUnit\Framework\TestCase;
use Keruald\GitHub\XHubSignature;
require 'XHubSignatureConstants.php';
-class XHubSignatureTest extends PHPUnit_Framework_TestCase {
+class XHubSignatureTest extends TestCase {
protected $defaultInstance;
protected $tigerInstance;
- protected function setUp() {
+ protected function setUp() : void {
$this->defaultInstance = new XHubSignature(SECRET);
$this->tigerInstance = new XHubSignature(SECRET, TIGER_ALGO);
@@ -16,7 +18,7 @@
$this->tigerInstance->payload = TIGER_PAYLOAD;
}
- public function testValidate () {
+ public function testValidate () : void {
$this->defaultInstance->signature = "";
$this->assertFalse($this->defaultInstance->validate());
@@ -27,7 +29,7 @@
$this->assertTrue($this->defaultInstance->validate());
}
- public function testCompute () {
+ public function testCompute () : void {
$this->assertSame(
DEFAULT_SIGNATURE,
$this->defaultInstance->compute()
@@ -43,10 +45,8 @@
/// Test static helper methods
///
- /**
- * @covers XHubSignature::validatePayload
- */
- public function testhashPayload () {
+ #[CoversFunction(XHubSignature::validatePayload)]
+ public function testhashPayload () : void {
$this->assertSame(
EMPTY_DEFAULT_HASH_ALGO_SIGNATURE,
XHubSignature::hashPayload("", "")
@@ -57,10 +57,8 @@
);
}
- /**
- * @covers XHubSignature::validatePayload
- */
- public function testValidatePayload () {
+ #[CoversFunction(XHubSignature::validatePayload)]
+ public function testValidatePayload () : void {
$this->assertFalse(XHubSignature::validatePayload("", "", ""));
$this->assertTrue(XHubSignature::validatePayload(
@@ -71,7 +69,7 @@
));
}
- public function testParseSignature () {
+ public function testParseSignature () : void {
$this->assertSame(
TIGER_SIGNATURE,
XHubSignature::parseSignature(TIGER_SIGNATURE)

File Metadata

Mime Type
text/plain
Expires
Thu, Dec 26, 11:42 (2 h, 56 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2315678
Default Alt Text
D3528.diff (2 KB)

Event Timeline