Skip to content

Commit 4b92c63

Browse files
no message
1 parent b1a47dc commit 4b92c63

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+262
-262
lines changed

tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/CastTest.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -90,23 +90,23 @@ public function can_use_in_complex_query(): void
9090
{
9191
$dql = 'SELECT t.id, CAST(t.text1 AS INTEGER) as casted_text FROM Fixtures\\MartinGeorgiev\\Doctrine\\Entity\\ContainsTexts t WHERE t.id IN (1, 2, 3)';
9292
$result = $this->executeDqlQuery($dql);
93-
static::assertNotEmpty($result);
93+
$this->assertNotEmpty($result);
9494
}
9595

9696
#[Test]
9797
public function can_convert_numeric_to_integer(): void
9898
{
9999
$dql = 'SELECT CAST(n.decimal1 AS INTEGER) AS result FROM Fixtures\\MartinGeorgiev\\Doctrine\\Entity\\ContainsNumerics n WHERE n.id = 1';
100100
$result = $this->executeDqlQuery($dql);
101-
static::assertSame(11, $result[0]['result']); // PostgreSQL rounds 10.5 to 11
101+
$this->assertSame(11, $result[0]['result'], 'PostgreSQL is expected to round 10.5 to 11');
102102
}
103103

104104
#[Test]
105105
public function can_convert_numeric_to_decimal(): void
106106
{
107107
$dql = 'SELECT CAST(n.integer1 AS DECIMAL(10, 2)) AS result FROM Fixtures\\MartinGeorgiev\\Doctrine\\Entity\\ContainsNumerics n WHERE n.id = 1';
108108
$result = $this->executeDqlQuery($dql);
109-
static::assertEquals('10.00', $result[0]['result']);
109+
$this->assertEquals('10.00', $result[0]['result']);
110110
}
111111

112112
#[Test]
@@ -130,26 +130,26 @@ public function can_use_lowercase_array_types(): void
130130
{
131131
$dql = 'SELECT CAST(a.integerArray AS int[]) AS result FROM Fixtures\\MartinGeorgiev\\Doctrine\\Entity\\ContainsArrays a WHERE a.id = 1';
132132
$result = $this->executeDqlQuery($dql);
133-
static::assertIsString($result[0]['result']);
134-
static::assertStringContainsString('{', $result[0]['result']);
133+
$this->assertIsString($result[0]['result']);
134+
$this->assertStringContainsString('{', $result[0]['result']);
135135
}
136136

137137
#[Test]
138138
public function can_use_mixed_case_array_types(): void
139139
{
140140
$dql = 'SELECT CAST(a.integerArray AS Text[]) AS result FROM Fixtures\\MartinGeorgiev\\Doctrine\\Entity\\ContainsArrays a WHERE a.id = 1';
141141
$result = $this->executeDqlQuery($dql);
142-
static::assertIsString($result[0]['result']);
143-
static::assertStringContainsString('{', $result[0]['result']);
142+
$this->assertIsString($result[0]['result']);
143+
$this->assertStringContainsString('{', $result[0]['result']);
144144
}
145145

146146
#[Test]
147147
public function can_use_parameterized_decimal_array(): void
148148
{
149149
$dql = 'SELECT CAST(a.integerArray AS DECIMAL(10, 2)[]) AS result FROM Fixtures\\MartinGeorgiev\\Doctrine\\Entity\\ContainsArrays a WHERE a.id = 1';
150150
$result = $this->executeDqlQuery($dql);
151-
static::assertIsString($result[0]['result']);
152-
static::assertStringContainsString('{', $result[0]['result']);
151+
$this->assertIsString($result[0]['result']);
152+
$this->assertStringContainsString('{', $result[0]['result']);
153153
}
154154

155155
private function createTestTableForTextFixture(): void

tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/ToCharTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,47 +35,47 @@ public function tochar_for_timestamp(): void
3535
{
3636
$dql = "SELECT to_char(t.datetimetz1, 'HH12:MI:SS') AS result FROM Fixtures\\MartinGeorgiev\\Doctrine\\Entity\\ContainsDates t WHERE t.id = 1";
3737
$result = $this->executeDqlQuery($dql);
38-
static::assertSame('10:30:00', $result[0]['result']);
38+
$this->assertSame('10:30:00', $result[0]['result']);
3939
}
4040

4141
#[Test]
4242
public function tochar_for_interval(): void
4343
{
4444
$dql = "SELECT to_char(t.dateinterval1, 'HH24:MI:SS') AS result FROM Fixtures\\MartinGeorgiev\\Doctrine\\Entity\\ContainsDates t WHERE t.id = 1";
4545
$result = $this->executeDqlQuery($dql);
46-
static::assertSame('15:02:12', $result[0]['result']);
46+
$this->assertSame('15:02:12', $result[0]['result']);
4747
}
4848

4949
#[Test]
5050
public function tochar_for_numeric(): void
5151
{
5252
$dql = "SELECT to_char(t.decimal1, '999D99S') AS result FROM Fixtures\\MartinGeorgiev\\Doctrine\\Entity\\ContainsNumerics t WHERE t.id = 1";
5353
$result = $this->executeDqlQuery($dql);
54-
static::assertSame('125.80-', $result[0]['result']);
54+
$this->assertSame('125.80-', $result[0]['result']);
5555
}
5656

5757
#[Test]
5858
public function tochar_for_numeric_literal(): void
5959
{
6060
$dql = "SELECT to_char(125.80, '999D99S') AS result FROM Fixtures\\MartinGeorgiev\\Doctrine\\Entity\\ContainsNumerics t WHERE t.id = 1";
6161
$result = $this->executeDqlQuery($dql);
62-
static::assertSame('125.80+', $result[0]['result']);
62+
$this->assertSame('125.80+', $result[0]['result']);
6363
}
6464

6565
#[Test]
6666
public function tochar_for_numeric_literal_negative(): void
6767
{
6868
$dql = "SELECT to_char(-125.80, '999D99S') AS result FROM Fixtures\\MartinGeorgiev\\Doctrine\\Entity\\ContainsNumerics t WHERE t.id = 1";
6969
$result = $this->executeDqlQuery($dql);
70-
static::assertSame('125.80-', $result[0]['result']);
70+
$this->assertSame('125.80-', $result[0]['result']);
7171
}
7272

7373
#[Test]
7474
public function tochar_with_subfunction(): void
7575
{
7676
$dql = "SELECT to_char(to_timestamp('05 Dec 2000 at 11:55 and 32 seconds', 'DD Mon YYYY tt HH24:MI ttt SS ttttttt'), 'HH24:MI:SS') AS result FROM Fixtures\\MartinGeorgiev\\Doctrine\\Entity\\ContainsDates t WHERE t.id = 1";
7777
$result = $this->executeDqlQuery($dql);
78-
static::assertSame('11:55:32', $result[0]['result']);
78+
$this->assertSame('11:55:32', $result[0]['result']);
7979
}
8080

8181
#[Test]

tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/ToNumberTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function tonumber(): void
2323
{
2424
$dql = "SELECT to_number('12,454.8-', '99G999D9S') as result FROM Fixtures\\MartinGeorgiev\\Doctrine\\Entity\\ContainsTexts t WHERE t.id = 1";
2525
$result = $this->executeDqlQuery($dql);
26-
static::assertSame('-12454.8', $result[0]['result']);
26+
$this->assertSame('-12454.8', $result[0]['result']);
2727
}
2828

2929
#[Test]

tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/ToTimestampTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function totimestamp(): void
2323
{
2424
$dql = "SELECT to_timestamp('05 Dec 2000 at 11:55 and 32 seconds', 'DD Mon YYYY tt HH24:MI ttt SS ttttttt') as result FROM Fixtures\\MartinGeorgiev\\Doctrine\\Entity\\ContainsTexts t WHERE t.id = 1";
2525
$result = $this->executeDqlQuery($dql);
26-
static::assertSame('2000-12-05 11:55:32+00', $result[0]['result']);
26+
$this->assertSame('2000-12-05 11:55:32+00', $result[0]['result']);
2727
}
2828

2929
#[Test]
@@ -39,7 +39,7 @@ public function totimestamp_with_invalid_format(): void
3939
{
4040
$dql = "SELECT to_timestamp('05 Dec 2000', 'invalid_format') as result FROM Fixtures\\MartinGeorgiev\\Doctrine\\Entity\\ContainsTexts t WHERE t.id = 1";
4141
$result = $this->executeDqlQuery($dql);
42-
static::assertSame('2005-01-01 00:00:00+00', $result[0]['result']);
42+
$this->assertSame('2005-01-01 00:00:00+00', $result[0]['result']);
4343
}
4444

4545
#[Test]

tests/Integration/MartinGeorgiev/Utils/PostgresArrayToPHPArrayTransformerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ private function assertArrayRoundTrip(int $id, array $expected, string $descript
170170
{
171171
// Test direct retrieval
172172
$retrieved = $this->retrieveArray($id);
173-
self::assertEquals(
173+
$this->assertEquals(
174174
$expected,
175175
$retrieved,
176176
\sprintf('Direct retrieval failed for %s', $description)
@@ -179,7 +179,7 @@ private function assertArrayRoundTrip(int $id, array $expected, string $descript
179179
// Test text representation
180180
$postgresText = $this->retrieveArrayAsText($id);
181181
$parsed = PostgresArrayToPHPArrayTransformer::transformPostgresArrayToPHPArray($postgresText);
182-
self::assertEquals(
182+
$this->assertEquals(
183183
$expected,
184184
$parsed,
185185
\sprintf('Text representation parsing failed for %s', $description)

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ public function can_transform_from_php_value(?array $phpValue, ?string $postgres
4242
->method('isValidArrayItemForDatabase')
4343
->willReturn(true);
4444

45-
self::assertSame($postgresValue, $this->fixture->convertToDatabaseValue($phpValue, $this->platform));
45+
$this->assertSame($postgresValue, $this->fixture->convertToDatabaseValue($phpValue, $this->platform));
4646
}
4747

4848
#[DataProvider('provideValidTransformations')]
4949
#[Test]
5050
public function can_transform_to_php_value(?array $phpValue, ?string $postgresValue): void
5151
{
52-
self::assertEquals($phpValue, $this->fixture->convertToPHPValue($postgresValue, $this->platform));
52+
$this->assertEquals($phpValue, $this->fixture->convertToPHPValue($postgresValue, $this->platform));
5353
}
5454

5555
/**

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ abstract class BaseFloatArrayTestCase extends TestCase
1818
#[Test]
1919
public function can_detect_invalid_for_transformation_php_value(mixed $phpValue): void
2020
{
21-
self::assertFalse($this->fixture->isValidArrayItemForDatabase($phpValue));
21+
$this->assertFalse($this->fixture->isValidArrayItemForDatabase($phpValue));
2222
}
2323

2424
/**
@@ -43,14 +43,14 @@ public static function provideInvalidDatabaseValueInputs(): array
4343
#[Test]
4444
public function can_transform_from_php_value(float $phpValue, string $postgresValue): void
4545
{
46-
self::assertTrue($this->fixture->isValidArrayItemForDatabase($phpValue));
46+
$this->assertTrue($this->fixture->isValidArrayItemForDatabase($phpValue));
4747
}
4848

4949
#[DataProvider('provideValidTransformations')]
5050
#[Test]
5151
public function can_transform_to_php_value(float $phpValue, string $postgresValue): void
5252
{
53-
self::assertEquals($phpValue, $this->fixture->transformArrayItemForPHP($postgresValue));
53+
$this->assertEquals($phpValue, $this->fixture->transformArrayItemForPHP($postgresValue));
5454
}
5555

5656
/**

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ abstract class BaseIntegerArrayTestCase extends TestCase
1818
#[Test]
1919
public function can_detect_invalid_for_transformation_php_value(mixed $phpValue): void
2020
{
21-
self::assertFalse($this->fixture->isValidArrayItemForDatabase($phpValue));
21+
$this->assertFalse($this->fixture->isValidArrayItemForDatabase($phpValue));
2222
}
2323

2424
/**
@@ -44,14 +44,14 @@ public static function provideInvalidDatabaseValueInputs(): array
4444
#[Test]
4545
public function can_transform_from_php_value(int $phpValue, string $postgresValue): void
4646
{
47-
self::assertTrue($this->fixture->isValidArrayItemForDatabase($phpValue));
47+
$this->assertTrue($this->fixture->isValidArrayItemForDatabase($phpValue));
4848
}
4949

5050
#[DataProvider('provideValidTransformations')]
5151
#[Test]
5252
public function can_transform_to_php_value(int $phpValue, string $postgresValue): void
5353
{
54-
self::assertEquals($phpValue, $this->fixture->transformArrayItemForPHP($postgresValue));
54+
$this->assertEquals($phpValue, $this->fixture->transformArrayItemForPHP($postgresValue));
5555
}
5656

5757
/**

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ protected function throwInvalidItemException(): never
5252
#[Test]
5353
public function has_name(): void
5454
{
55-
self::assertEquals('test_network_array', $this->fixture->getName());
55+
$this->assertEquals('test_network_array', $this->fixture->getName());
5656
}
5757

5858
#[Test]
5959
#[DataProvider('provideValidTransformations')]
6060
public function can_transform_to_php_value(?array $phpValue, ?string $postgresValue): void
6161
{
62-
self::assertEquals($phpValue, $this->fixture->convertToPHPValue($postgresValue, $this->platform));
62+
$this->assertEquals($phpValue, $this->fixture->convertToPHPValue($postgresValue, $this->platform));
6363
}
6464

6565
public static function provideValidTransformations(): array

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ protected function setUp(): void
3838
#[Test]
3939
public function has_name(): void
4040
{
41-
self::assertEquals($this->getExpectedTypeName(), $this->fixture->getName());
41+
$this->assertEquals($this->getExpectedTypeName(), $this->fixture->getName());
4242
}
4343

4444
/**
@@ -48,7 +48,7 @@ public function has_name(): void
4848
#[Test]
4949
public function can_transform_from_php_value(?Range $range, ?string $postgresValue): void
5050
{
51-
self::assertEquals($postgresValue, $this->fixture->convertToDatabaseValue($range, $this->platform));
51+
$this->assertEquals($postgresValue, $this->fixture->convertToDatabaseValue($range, $this->platform));
5252
}
5353

5454
/**
@@ -61,11 +61,11 @@ public function can_transform_to_php_value(?Range $range, ?string $postgresValue
6161
$result = $this->fixture->convertToPHPValue($postgresValue, $this->platform);
6262

6363
if (!$range instanceof Range) {
64-
self::assertNull($result);
64+
$this->assertNull($result);
6565
} else {
66-
self::assertInstanceOf($this->getExpectedValueObjectClass(), $result);
67-
self::assertEquals($range->__toString(), $result->__toString());
68-
self::assertEquals($range->isEmpty(), $result->isEmpty());
66+
$this->assertInstanceOf($this->getExpectedValueObjectClass(), $result);
67+
$this->assertEquals($range->__toString(), $result->__toString());
68+
$this->assertEquals($range->isEmpty(), $result->isEmpty());
6969
}
7070
}
7171

@@ -79,33 +79,33 @@ public function can_transform_null_from_php_value(): void
7979
{
8080
$result = $this->fixture->convertToDatabaseValue(null, $this->platform);
8181

82-
self::assertNull($result);
82+
$this->assertNull($result);
8383
}
8484

8585
#[Test]
8686
public function can_transform_null_from_sql_value(): void
8787
{
8888
$result = $this->fixture->convertToPHPValue(null, $this->platform);
8989

90-
self::assertNull($result);
90+
$this->assertNull($result);
9191
}
9292

9393
#[Test]
9494
public function can_handle_postgres_empty_range(): void
9595
{
9696
$result = $this->fixture->convertToPHPValue('empty', $this->platform);
9797

98-
self::assertInstanceOf($this->getExpectedValueObjectClass(), $result);
99-
self::assertEquals('empty', (string) $result);
100-
self::assertTrue($result->isEmpty());
98+
$this->assertInstanceOf($this->getExpectedValueObjectClass(), $result);
99+
$this->assertEquals('empty', (string) $result);
100+
$this->assertTrue($result->isEmpty());
101101
}
102102

103103
#[Test]
104104
public function can_handle_empty_string_from_sql(): void
105105
{
106106
$result = $this->fixture->convertToPHPValue('', $this->platform);
107107

108-
self::assertNull($result);
108+
$this->assertNull($result);
109109
}
110110

111111
#[DataProvider('provideInvalidDatabaseValues')]

0 commit comments

Comments
 (0)