Skip to content

Commit

Permalink
Added regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm committed Oct 28, 2024
1 parent 16f34c0 commit c15f722
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/rules/UnresolvableQueryMethodRuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,9 @@ public function testBug547(): void
{
$this->analyse([__DIR__ . '/data/bug-547.php'], []);
}

public function testBug676(): void
{
$this->analyse([__DIR__ . '/data/bug-676.php'], []);
}
}
22 changes: 22 additions & 0 deletions tests/rules/data/bug-676.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

namespace Test;

use Doctrine\DBAL\Connection;

class Test
{
private Connection $connection;

public function getIds(iterable $ids): array
{
return $this
->connection
->executeQuery(
'SELECT id FROM table WHERE id IN (:list)',
['list' => $ids],
['list' => DBAL\Connection::PARAM_INT_ARRAY],
)
->fetchFirstColumn();
}
}

0 comments on commit c15f722

Please sign in to comment.