Skip to content

Commit 91e4e75

Browse files
committed
fix: replace static assertion for coding style respect
1 parent 8f5c647 commit 91e4e75

File tree

2 files changed

+23
-23
lines changed

2 files changed

+23
-23
lines changed

tests/Unit/MartinGeorgiev/Doctrine/DBAL/Types/LtreeTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ protected function setUp(): void
3030
#[Test]
3131
public function has_name(): void
3232
{
33-
self::assertSame('ltree', $this->fixture->getName());
33+
$this->assertSame('ltree', $this->fixture->getName());
3434
}
3535

3636
#[Test]
@@ -39,21 +39,21 @@ public function can_convert_string_to_database_value(): void
3939
$value = 'alpha.beta.gamma';
4040
$databaseValue = $this->fixture->convertToDatabaseValue($value, $this->platform);
4141

42-
self::assertSame($value, $databaseValue);
42+
$this->assertSame($value, $databaseValue);
4343
}
4444

4545
#[DataProvider('provideValidTransformations')]
4646
#[Test]
4747
public function can_transform_from_php_value(?LtreeValueObject $ltreeValueObject, ?string $postgresValue): void
4848
{
49-
self::assertSame($postgresValue, $this->fixture->convertToDatabaseValue($ltreeValueObject, $this->platform));
49+
$this->assertSame($postgresValue, $this->fixture->convertToDatabaseValue($ltreeValueObject, $this->platform));
5050
}
5151

5252
#[DataProvider('provideValidTransformations')]
5353
#[Test]
5454
public function can_transform_to_php_value(?LtreeValueObject $ltreeValueObject, ?string $postgresValue): void
5555
{
56-
self::assertEquals($ltreeValueObject, $this->fixture->convertToPHPValue($postgresValue, $this->platform));
56+
$this->assertEquals($ltreeValueObject, $this->fixture->convertToPHPValue($postgresValue, $this->platform));
5757
}
5858

5959
/**

tests/Unit/MartinGeorgiev/Doctrine/DBAL/Types/ValueObject/LtreeTest.php

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ final class LtreeTest extends TestCase
1616
public function can_create_from_list_of_strings(): void
1717
{
1818
$ltree = new Ltree(['a', 'b', 'c']);
19-
self::assertSame('a.b.c', (string) $ltree);
19+
$this->assertSame('a.b.c', (string) $ltree);
2020
}
2121

2222
/**
@@ -67,8 +67,8 @@ public static function provideInvalidStringRepresentation(): iterable
6767
public function can_create_from_string(string $value, array $expected): void
6868
{
6969
$ltree = Ltree::fromString($value);
70-
self::assertSame($expected, $ltree->getPathFromRoot());
71-
self::assertSame($value, (string) $ltree);
70+
$this->assertSame($expected, $ltree->getPathFromRoot());
71+
$this->assertSame($value, (string) $ltree);
7272
}
7373

7474
/**
@@ -79,7 +79,7 @@ public function can_create_from_string(string $value, array $expected): void
7979
public function can_convert_to_string(string $expected, array $value): void
8080
{
8181
$ltree = new Ltree($value);
82-
self::assertSame($expected, (string) $ltree);
82+
$this->assertSame($expected, (string) $ltree);
8383
}
8484

8585
/**
@@ -90,10 +90,10 @@ public function can_convert_to_string(string $expected, array $value): void
9090
public function can_serialize_to_json(string $value, array $expected): void
9191
{
9292
$ltreeFromString = Ltree::fromString($value);
93-
self::assertSame($expected, $ltreeFromString->jsonSerialize());
93+
$this->assertSame($expected, $ltreeFromString->jsonSerialize());
9494

9595
$ltree = new Ltree($expected);
96-
self::assertSame($expected, $ltree->jsonSerialize());
96+
$this->assertSame($expected, $ltree->jsonSerialize());
9797
}
9898

9999
/**
@@ -113,15 +113,15 @@ public function can_encode_to_json_array(): void
113113
{
114114
$ltree = new Ltree(['a', 'b', 'c']);
115115
$json = \json_encode($ltree, \JSON_THROW_ON_ERROR);
116-
self::assertSame('["a","b","c"]', $json);
116+
$this->assertSame('["a","b","c"]', $json);
117117
}
118118

119119
#[DataProvider('provideParentRelationship')]
120120
#[Test]
121121
public function can_get_parent(Ltree $child, Ltree $parent): void
122122
{
123123
$ltree = $child->getParent();
124-
self::assertSame((string) $parent, (string) $ltree);
124+
$this->assertSame((string) $parent, (string) $ltree);
125125
}
126126

127127
#[DataProvider('provideParentRelationship')]
@@ -130,8 +130,8 @@ public function respect_immutability_when_getting_parent(Ltree $child, Ltree $pa
130130
{
131131
$childAsString = (string) $child;
132132
$ltree = $child->getParent();
133-
self::assertNotSame($child, $ltree, 'getParent() should return a new instance');
134-
self::assertSame($childAsString, (string) $child, 'getParent() should not mutate the original instance');
133+
$this->assertNotSame($child, $ltree, 'getParent() should return a new instance');
134+
$this->assertSame($childAsString, (string) $child, 'getParent() should not mutate the original instance');
135135
}
136136

137137
/**
@@ -161,10 +161,10 @@ public function throws_exception_when_getting_empty_ltree_parent(): void
161161
public function can_verify_empty_status(): void
162162
{
163163
$ltree = new Ltree([]);
164-
self::assertTrue($ltree->isEmpty());
164+
$this->assertTrue($ltree->isEmpty());
165165

166166
$ltreeWithNodes = new Ltree(['a', 'b']);
167-
self::assertFalse($ltreeWithNodes->isEmpty());
167+
$this->assertFalse($ltreeWithNodes->isEmpty());
168168
}
169169

170170
#[Test]
@@ -173,9 +173,9 @@ public function can_verify_root_status(): void
173173
$emptyRoot = new Ltree([]);
174174
$root = new Ltree(['a']);
175175
$notRoot = new Ltree(['a', 'b']);
176-
self::assertFalse($emptyRoot->isRoot());
177-
self::assertTrue($root->isRoot());
178-
self::assertFalse($notRoot->isRoot());
176+
$this->assertFalse($emptyRoot->isRoot());
177+
$this->assertTrue($root->isRoot());
178+
$this->assertFalse($notRoot->isRoot());
179179
}
180180

181181
/**
@@ -195,7 +195,7 @@ public function can_verify_relationship(
195195
array $expected,
196196
): void {
197197
foreach ($expected as $method => $value) {
198-
self::assertSame(
198+
$this->assertSame(
199199
$value,
200200
$left->{$method}($right),
201201
\sprintf('Failed %s check', $method),
@@ -476,7 +476,7 @@ public static function provideFamilyRelationshipWithExpectedResults(): iterable
476476
public function can_create_leaf(Ltree $parent, string $leaf, Ltree $expected): void
477477
{
478478
$ltree = $parent->withLeaf($leaf);
479-
self::assertSame((string) $expected, (string) $ltree);
479+
$this->assertSame((string) $expected, (string) $ltree);
480480
}
481481

482482
/**
@@ -488,8 +488,8 @@ public function respects_immutability_when_creating_leaf(Ltree $parent, string $
488488
{
489489
$parentAsString = (string) $parent;
490490
$ltree = $parent->withLeaf($leaf);
491-
self::assertNotSame($parent, $ltree, 'withLeaf() should return a new instance');
492-
self::assertSame($parentAsString, (string) $parent, 'withLeaf() should not mutate the original instance');
491+
$this->assertNotSame($parent, $ltree, 'withLeaf() should return a new instance');
492+
$this->assertSame($parentAsString, (string) $parent, 'withLeaf() should not mutate the original instance');
493493
}
494494

495495
/**

0 commit comments

Comments
 (0)