Skip to content

Commit 754094e

Browse files
committed
Fix PHPStan-issues (tests) and set a baseline
1 parent dae8466 commit 754094e

File tree

4 files changed

+18
-3
lines changed

4 files changed

+18
-3
lines changed

phpstan-baseline-dev.neon

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
parameters:
22
ignoreErrors:
3+
-
4+
message: '#^Call to an undefined method Mockery\\Expectation\:\:shouldReceive\(\)\.$#'
5+
identifier: method.notFound
6+
count: 2
7+
path: tests/SAML2/Assertion/Validation/ConstraintValidator/SubjectConfirmationMethodTest.php
8+
39
-
410
message: '#^Call to an undefined method Mockery\\Expectation\:\:shouldReceive\(\)\.$#'
511
identifier: method.notFound

src/SAML2/Assertion/Validation/ConstraintValidator/SubjectConfirmationMethod.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function validate(
2121
): void {
2222
if ($subjectConfirmation->getMethod() !== Constants::CM_BEARER) {
2323
$result->addError(sprintf(
24-
'Invalid Method on SubjectConfirmation, current;y only Bearer (%s) is supported',
24+
'Invalid Method on SubjectConfirmation, currently only Bearer (%s) is supported',
2525
Constants::CM_BEARER
2626
));
2727
}

tests/SAML2/Assertion/Validation/ConstraintValidator/SubjectConfirmationMethodTest.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,17 @@ public function setUp(): void
3737
#[Test]
3838
public function subjectConfirmationWithBearerMethodIsValid(): void
3939
{
40+
$this->subjectConfirmation
41+
->shouldReceive('setMethod')
42+
->once()
43+
->shouldReceive('getMethod')
44+
->andReturn(Constants::CM_BEARER);
4045
$this->subjectConfirmation->setMethod(Constants::CM_BEARER);
4146

4247
$validator = new SubjectConfirmationMethod();
4348
$result = new Result();
4449

4550
$validator->validate($this->subjectConfirmation, $result);
46-
4751
$this->assertTrue($result->isValid());
4852
}
4953

@@ -54,6 +58,11 @@ public function subjectConfirmationWithBearerMethodIsValid(): void
5458
#[Test]
5559
public function subjectConfirmationWithHolderOfKeyMethodIsNotValid(): void
5660
{
61+
$this->subjectConfirmation
62+
->shouldReceive('setMethod')
63+
->once()
64+
->shouldReceive('getMethod')
65+
->andReturn(Constants::CM_HOK);
5766
$this->subjectConfirmation->setMethod(Constants::CM_HOK);
5867

5968
$validator = new SubjectConfirmationMethod();

tests/SAML2/Assertion/Validation/ConstraintValidator/SubjectConfirmationResponseToMatchesTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class SubjectConfirmationResponseToMatchesTest extends \Mockery\Adapter\Phpunit\
2222
/**
2323
* @var \Mockery\MockInterface&\SAML2\XML\saml\SubjectConfirmationData
2424
*/
25-
private SubjectConfirmationData&MockInterface$subjectConfirmationData;
25+
private SubjectConfirmationData&MockInterface $subjectConfirmationData;
2626

2727
/**
2828
* @var \Mockery\MockInterface&\SAML2\Response

0 commit comments

Comments
 (0)