Skip to content

Commit 02ee4e4

Browse files
committed
Refactor outdated PHPUnit method calls
1 parent 7fbda6b commit 02ee4e4

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

tests/ImageTests/Standalone/EntrypointTest.php

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

55
namespace CodedMonkey\Dirigent\Tests\ImageTests\Standalone;
66

7+
use PHPUnit\Framework\Attributes\DoesNotPerformAssertions;
78
use PHPUnit\Framework\TestCase;
89
use Testcontainers\Container\GenericContainer;
910
use Testcontainers\Wait\WaitForLog;
1011

1112
class EntrypointTest extends TestCase
1213
{
14+
#[DoesNotPerformAssertions]
1315
public function testInit(): void
1416
{
1517
// Running the container without a command must result in a running application.
@@ -18,16 +20,12 @@ public function testInit(): void
1820
->start()
1921
->stop();
2022

21-
$this->addToAssertionCount(1);
22-
2323
// Running the container with the `-init` command must result in a running application.
2424
new GenericContainer('dirigent-standalone')
2525
->withCommand(['-init'])
2626
->withWait(new WaitForLog('ready to handle connections'))
2727
->start()
2828
->stop();
29-
30-
$this->addToAssertionCount(1);
3129
}
3230

3331
public function testDirigent(): void

tests/UnitTests/Encryption/EncryptionTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function testRevealFailsWithInvalidPublicKey(): void
7575
$sealedData = $encryption->seal(self::DATA);
7676

7777
$this->expectException(EncryptionException::class);
78-
$this->expectExceptionMessage('Unable to decrypt data');
78+
$this->expectExceptionMessageIsOrContains('Unable to decrypt data');
7979

8080
$encryption->reveal($sealedData);
8181
}
@@ -140,7 +140,7 @@ public function testValidateFailsWithInvalidPublicKey(): void
140140
$publicKey = sodium_crypto_box_publickey(sodium_crypto_box_keypair());
141141

142142
$this->expectException(EncryptionException::class);
143-
$this->expectExceptionMessage('The encryption key is not valid.');
143+
$this->expectExceptionMessageIsOrContains('The encryption key is not valid.');
144144

145145
$encryption = new Encryption($privateKey, $publicKey, []);
146146

0 commit comments

Comments
 (0)