Skip to content

Commit 0614887

Browse files
committed
Cleanup unnecessary mockery
1 parent 8a919ce commit 0614887

16 files changed

Lines changed: 42 additions & 57 deletions

tests/SAML2/Assertion/ProcessorTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace SimpleSAML\Test\SAML2\Assertion;
66

7-
use Mockery as m;
7+
use Mockery;
88
use Mockery\MockInterface;
99
use Mockery\Adapter\Phpunit\MockeryTestCase;
1010
use Psr\Log\LoggerInterface;
@@ -42,13 +42,13 @@ final class ProcessorTest extends MockeryTestCase
4242

4343
protected function setUp(): void
4444
{
45-
$this->decrypter = m::mock(Decrypter::class);
46-
$validator = m::mock(Validator::class);
47-
$assertionValidator = m::mock(AssertionValidator::class);
48-
$subjectConfirmationValidator = m::mock(SubjectConfirmationValidator::class);
49-
$transformer = m::mock(TransformerInterface::class);
45+
$this->decrypter = Mockery::mock(Decrypter::class);
46+
$validator = Mockery::mock(Validator::class);
47+
$assertionValidator = Mockery::mock(AssertionValidator::class);
48+
$subjectConfirmationValidator = Mockery::mock(SubjectConfirmationValidator::class);
49+
$transformer = Mockery::mock(TransformerInterface::class);
5050
$identityProvider = new IdentityProvider([]);
51-
$logger = m::mock(LoggerInterface::class);
51+
$logger = Mockery::mock(LoggerInterface::class);
5252

5353
$this->processor = new Processor(
5454
$this->decrypter,

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ final class NotBeforeTest extends ControlledTimeTest
2929
/**
3030
* @var \SAML2\XML\saml\Issuer
3131
*/
32-
private $issuer;
32+
private Issuer $issuer;
3333

3434
/**
3535
* @var \SAML2\XML\saml\AuthnStatement
3636
*/
37-
private $authnStatement;
37+
private AuthnStatement $authnStatement;
3838

3939

4040
/**

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ final class NotOnOrAfterTest extends ControlledTimeTest
2929
/**
3030
* @var \SAML2\XML\saml\Issuer
3131
*/
32-
private $issuer;
32+
private Issuer $issuer;
3333

3434
/**
3535
* @var \SAML2\XML\saml\AuthnStatement
3636
*/
37-
private $authnStatement;
37+
private AuthnStatement $authnStatement;
3838

3939

4040
/**

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ final class SessionNotOnOrAfterTest extends ControlledTimeTest
2828
/**
2929
* @var \SAML2\XML\saml\Issuer
3030
*/
31-
private $issuer;
31+
private Issuer $issuer;
3232

3333

3434
/**

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace SimpleSAML\Test\SAML2\Assertion\Validation\ConstraintValidator;
66

7-
use Mockery\Adapter\Phpunit\MockeryTestCase;
7+
use PHPUnit\Framework\TestCase;
88
use SimpleSAML\SAML2\Assertion\Validation\ConstraintValidator\SubjectConfirmationMethod;
99
use SimpleSAML\SAML2\Assertion\Validation\Result;
1010
use SimpleSAML\SAML2\Constants as C;
@@ -14,7 +14,7 @@
1414
* @covers \SimpleSAML\SAML2\Assertion\Validation\ConstraintValidator\SubjectConfirmationMethod
1515
* @package simplesamlphp/saml2
1616
*/
17-
final class SubjectConfirmationMethodTest extends MockeryTestCase
17+
final class SubjectConfirmationMethodTest extends TestCase
1818
{
1919
/**
2020
* @group assertion-validation

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

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,22 @@
1717
*
1818
* @covers \SimpleSAML\SAML2\Assertion\Validation\ConstraintValidator\SubjectConfirmationNotBefore
1919
* @package simplesamlphp/saml2
20+
*
21+
* @runTestsInSeparateProcesses
2022
*/
2123
final class SubjectConfirmationNotBeforeTest extends ControlledTimeTest
2224
{
2325
/**
2426
* @group assertion-validation
2527
* @test
26-
*
27-
* @runInSeparateProcess
28-
* @preserveGlobalState disabled
2928
*/
3029
public function timestampInTheFutureBeyondGraceperiodIsNotValid(): void
3130
{
3231
$subjectConfirmationData = new SubjectConfirmationData($this->currentTime + 61);
3332
$subjectConfirmation = new SubjectConfirmation(C::CM_HOK, null, $subjectConfirmationData);
3433

3534
$validator = new SubjectConfirmationNotBefore();
36-
$result = new Result();
35+
$result = new Result();
3736

3837
$validator->validate($subjectConfirmation, $result);
3938

@@ -45,17 +44,14 @@ public function timestampInTheFutureBeyondGraceperiodIsNotValid(): void
4544
/**
4645
* @group assertion-validation
4746
* @test
48-
*
49-
* @runInSeparateProcess
50-
* @preserveGlobalState disabled
5147
*/
5248
public function timeWithinGraceperiodIsValid(): void
5349
{
5450
$subjectConfirmationData = new SubjectConfirmationData(null, $this->currentTime + 60);
5551
$subjectConfirmation = new SubjectConfirmation(C::CM_HOK, null, $subjectConfirmationData);
5652

5753
$validator = new SubjectConfirmationNotBefore();
58-
$result = new Result();
54+
$result = new Result();
5955

6056
$validator->validate($subjectConfirmation, $result);
6157

@@ -66,17 +62,14 @@ public function timeWithinGraceperiodIsValid(): void
6662
/**
6763
* @group assertion-validation
6864
* @test
69-
*
70-
* @runInSeparateProcess
71-
* @preserveGlobalState disabled
7265
*/
7366
public function currentTimeIsValid(): void
7467
{
7568
$subjectConfirmationData = new SubjectConfirmationData($this->currentTime);
7669
$subjectConfirmation = new SubjectConfirmation(C::CM_HOK, null, $subjectConfirmationData);
7770

7871
$validator = new SubjectConfirmationNotBefore();
79-
$result = new Result();
72+
$result = new Result();
8073

8174
$validator->validate($subjectConfirmation, $result);
8275

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

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,22 @@
1818
*
1919
* @covers \SimpleSAML\SAML2\Assertion\Validation\ConstraintValidator\SubjectConfirmationNotOnOrAfter
2020
* @package simplesamlphp/saml2
21+
*
22+
* @runTestsInSeparateProcesses
2123
*/
2224
final class SubjectConfirmationNotOnOrAfterTest extends ControlledTimeTest
2325
{
2426
/**
2527
* @group assertion-validation
2628
* @test
27-
*
28-
* @runInSeparateProcess
29-
* @preserveGlobalState disabled
3029
*/
3130
public function timestampInThePastBeforeGraceperiodIsNotValid(): void
3231
{
3332
$subjectConfirmationData = new SubjectConfirmationData(null, $this->currentTime - 60);
3433
$subjectConfirmation = new SubjectConfirmation(C::CM_HOK, null, $subjectConfirmationData);
3534

3635
$validator = new SubjectConfirmationNotOnOrAfter();
37-
$result = new Result();
36+
$result = new Result();
3837

3938
$validator->validate($subjectConfirmation, $result);
4039

@@ -46,17 +45,14 @@ public function timestampInThePastBeforeGraceperiodIsNotValid(): void
4645
/**
4746
* @group assertion-validation
4847
* @test
49-
*
50-
* @runInSeparateProcess
51-
* @preserveGlobalState disabled
5248
*/
5349
public function timeWithinGraceperiodIsValid(): void
5450
{
5551
$subjectConfirmationData = new SubjectConfirmationData(null, $this->currentTime - 59);
5652
$subjectConfirmation = new SubjectConfirmation(C::CM_HOK, null, $subjectConfirmationData);
5753

5854
$validator = new SubjectConfirmationNotOnOrAfter();
59-
$result = new Result();
55+
$result = new Result();
6056

6157
$validator->validate($subjectConfirmation, $result);
6258

@@ -67,17 +63,14 @@ public function timeWithinGraceperiodIsValid(): void
6763
/**
6864
* @group assertion-validation
6965
* @test
70-
*
71-
* @runInSeparateProcess
72-
* @preserveGlobalState disabled
7366
*/
7467
public function currentTimeIsValid(): void
7568
{
7669
$subjectConfirmationData = new SubjectConfirmationData(null, $this->currentTime);
7770
$subjectConfirmation = new SubjectConfirmation(C::CM_HOK, null, $subjectConfirmationData);
7871

7972
$validator = new SubjectConfirmationNotBefore();
80-
$result = new Result();
73+
$result = new Result();
8174

8275
$validator->validate($subjectConfirmation, $result);
8376

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace SimpleSAML\Test\SAML2\Assertion\Validation\ConstraintValidator;
66

7-
use Mockery\Adapter\Phpunit\MockeryTestCase;
7+
use PHPUnit\Framework\TestCase;
88
use SimpleSAML\SAML2\Assertion\Validation\ConstraintValidator\SubjectConfirmationRecipientMatches;
99
use SimpleSAML\SAML2\Assertion\Validation\ConstraintValidator\SubjectConfirmationResponseToMatches;
1010
use SimpleSAML\SAML2\Assertion\Validation\Result;
@@ -18,7 +18,7 @@
1818
* @covers \SimpleSAML\SAML2\Assertion\Validation\ConstraintValidator\SubjectConfirmationRecipientMatches
1919
* @package simplesamlphp/saml2
2020
*/
21-
final class SubjectConfirmationRecipientMatchesTest extends MockeryTestCase
21+
final class SubjectConfirmationRecipientMatchesTest extends TestCase
2222
{
2323
/**
2424
* @group assertion-validation

tests/SAML2/Certificate/KeyCollectionTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44

55
namespace SimpleSAML\Test\SAML2\Certificate;
66

7-
use Mockery\Adapter\Phpunit\MockeryTestCase;
7+
use PHPUnit\Framework\TestCase;
88
use SimpleSAML\Assert\AssertionFailedException;
99
use SimpleSAML\SAML2\Certificate\KeyCollection;
1010

1111
/**
1212
* @covers \SimpleSAML\SAML2\Certificate\KeyCollection
1313
* @package simplesamlphp/saml2
1414
*/
15-
final class KeyCollectionTest extends MockeryTestCase
15+
final class KeyCollectionTest extends TestCase
1616
{
1717
/**
1818
* @group certificate

tests/SAML2/Certificate/PrivateKeyTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44

55
namespace SimpleSAML\Test\SAML2\Certificate;
66

7-
use Mockery\Adapter\Phpunit\MockeryTestCase;
7+
use PHPUnit\Framework\TestCase;
88
use SimpleSAML\SAML2\Certificate\PrivateKey;
99
use SimpleSAML\XMLSecurity\TestUtils\PEMCertificatesMock;
1010

1111
/**
1212
* @covers \SimpleSAML\SAML2\Certificate\PrivateKey
1313
* @package simplesamlphp/saml2
1414
*/
15-
final class PrivateKeyTest extends MockeryTestCase
15+
final class PrivateKeyTest extends TestCase
1616
{
1717
/**
1818
* @group certificate

0 commit comments

Comments
 (0)