Skip to content

Commit 7624a8a

Browse files
committed
fix expectations
1 parent d184c18 commit 7624a8a

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

tests/default/data/dibi.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function fetch(\Dibi\Connection $connection)
1919
public function fetchAll(\Dibi\Connection $connection)
2020
{
2121
$row = $connection->fetchAll('SELECT email, adaid FROM ada');
22-
assertType('array<int, array{email: string, adaid: int<-32768, 32767>}>', $row);
22+
assertType('list<array{email: string, adaid: int<-32768, 32767>}>', $row);
2323
}
2424

2525
public function fetchPairs(\Dibi\Connection $connection)

tests/default/data/runMysqlQuery.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ class Foo
2525
public function run(string $prodHostname, DbCredentials $dbCredentials)
2626
{
2727
$prodDomains = runMysqlQuery('SELECT cmsdomainid FROM cmsdomain WHERE url ="'.$prodHostname.'" and standard=1', $dbCredentials);
28-
assertType('array<int, array<int, string>>|null', $prodDomains);
28+
assertType('list<list<string>>|null', $prodDomains);
2929
// XXX should be more precise, when we would be smarter in query parsing
30-
// assertType('array<int, array{string}>|null', $prodDomains);
30+
// assertType('list<array{string}>|null', $prodDomains);
3131
}
3232
}

tests/rules/DoctrineKeyValueStyleRuleTest.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ public static function getAdditionalConfigFiles(): array
2727

2828
public function testRule(): void
2929
{
30+
$err56 = 'Query error: Column "ada.adaid" expects value type int, got type mixed';
31+
if (PHP_VERSION_ID < 80000) {
32+
// PHP 7.x does not support native mixed type
33+
$err56 = 'Query error: Column "ada.adaid" expects value type int, got type DoctrineKeyValueStyleRuleTest\mixed';
34+
}
35+
3036
$expectedErrors = [
3137
[
3238
'Argument #0 expects a constant string, got string',
@@ -65,7 +71,7 @@ public function testRule(): void
6571
51,
6672
],
6773
[
68-
'Query error: Column "ada.adaid" expects value type int, got type mixed',
74+
$err56,
6975
56,
7076
],
7177
[

0 commit comments

Comments
 (0)