Skip to content

Commit 680a9ef

Browse files
committed
Migrate away from assertStringNotMatchesFormat()
It has been deprecated.
1 parent 9d5f112 commit 680a9ef

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

tests/Tests/ORM/Functional/Ticket/DDC3042Test.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
use Doctrine\Tests\OrmFunctionalTestCase;
1212
use PHPUnit\Framework\Attributes\Group;
1313

14+
use function substr_count;
15+
1416
#[Group('DDC-3042')]
1517
class DDC3042Test extends OrmFunctionalTestCase
1618
{
@@ -23,14 +25,18 @@ protected function setUp(): void
2325

2426
public function testSQLGenerationDoesNotProvokeAliasCollisions(): void
2527
{
26-
self::assertStringNotMatchesFormat(
27-
'%sfield11%sfield11%s',
28-
$this
28+
self::assertSame(
29+
1,
30+
substr_count(
31+
$this
2932
->_em
3033
->createQuery(
3134
'SELECT f, b FROM ' . __NAMESPACE__ . '\DDC3042Foo f JOIN ' . __NAMESPACE__ . '\DDC3042Bar b WITH 1 = 1',
3235
)
3336
->getSQL(),
37+
'field_11',
38+
),
39+
'The alias "field11" should only appear once in the SQL query.',
3440
);
3541
}
3642
}

0 commit comments

Comments
 (0)