Skip to content

Commit

Permalink
refactor: refactored tests
Browse files Browse the repository at this point in the history
  • Loading branch information
petrknap committed Nov 2, 2024
1 parent 7f0dd93 commit 5aa356f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions tests/Coder/CoderTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@

abstract class CoderTestCase extends TestCase
{
protected const DATA_BASE64 = '2jmj7l5rSw0yVb/vlWAYkK/YBwnaOaPuXmtLDTJVv++VYBiQr9gHCdo5o+5ea0sNMlW/75VgGJCv2AcJ';
public const DATA_BASE64 = '2jmj7l5rSw0yVb/vlWAYkK/YBwnaOaPuXmtLDTJVv++VYBiQr9gHCdo5o+5ea0sNMlW/75VgGJCv2AcJ';

abstract public static function data(): array;

protected static function getDecodedData(): string
public static function getDecodedData(): string
{
return base64_decode(self::DATA_BASE64);
}

protected static function getEncodedData(): string
public static function getEncodedData(): string
{
foreach (static::data() as $data) {
return $data[1];
Expand Down
2 changes: 1 addition & 1 deletion tests/Coder/ZlibTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function testEncodeThrows(int|null $encoding, int|null $level): void
{
self::expectException(Exception\CoderCouldNotEncodeData::class);

(new zlib())->encode(
(new Zlib())->encode(
self::getDecodedData(),
encoding: $encoding,
level: $level,
Expand Down
4 changes: 2 additions & 2 deletions tests/Serializer/SerializerTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public function testSerializesSerializable(): void
{
self::assertEquals(
static::getSerialized(),
static::getSerializer()->serialize(static::getSerializable()),
static::getSerializer()->serialize(self::getSerializable()),
);
}

Expand All @@ -28,7 +28,7 @@ public function testSerializeThrowsOnNonserializable(): void
public function testUnserializesSerialized(): void
{
self::assertEquals(
static::getSerializable(),
self::getSerializable(),
static::getSerializer()->unserialize(static::getSerialized()),
);
}
Expand Down

0 comments on commit 5aa356f

Please sign in to comment.