Skip to content

Commit

Permalink
Support PHPUnit 10, Psalm 5
Browse files Browse the repository at this point in the history
  • Loading branch information
paragonie-security committed May 24, 2023
1 parent 9619634 commit 4ccd346
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
"psr/http-message": "^1|^2"
},
"require-dev": {
"phpunit/phpunit": "^7|^8|^9",
"phpunit/phpunit": "^7|^8|^9|^10",
"squizlabs/php_codesniffer": "^3",
"vimeo/psalm": "^4"
"vimeo/psalm": "^4|^5"
},
"scripts": {
"test": "phpunit && psalm"
Expand Down
8 changes: 4 additions & 4 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
backupGlobals="true"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnError="false"
stopOnFailure="false"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.1/phpunit.xsd"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false"
>
<testsuites>
<testsuite name="CSP Builder Test Suite">
Expand Down
4 changes: 2 additions & 2 deletions test/BasicTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public function testPreHash()
public function testSourceHttpsConversion()
{
/** @var CSPBuilder|MockObject $cspHttp */
$cspHttp = $this->getMockBuilder(CSPBuilder::class)->setMethods(['isHTTPSConnection'])
$cspHttp = $this->getMockBuilder(CSPBuilder::class)->onlyMethods(['isHTTPSConnection'])
->disableOriginalConstructor()->getMock();
$cspHttp->method('isHTTPSConnection')->willReturn(false);

Expand All @@ -135,7 +135,7 @@ public function testSourceHttpsConversion()
$this->assertStringContainsString('http://another.com', $compiledCspHttp);

/** @var CSPBuilder|MockObject $cspHttps */
$cspHttps = $this->getMockBuilder(CSPBuilder::class)->setMethods(['isHTTPSConnection'])
$cspHttps = $this->getMockBuilder(CSPBuilder::class)->onlyMethods(['isHTTPSConnection'])
->disableOriginalConstructor()->getMock();
$cspHttps->method('isHTTPSConnection')->willReturn(true);

Expand Down

0 comments on commit 4ccd346

Please sign in to comment.