Skip to content

Commit 19762db

Browse files
committed
Refactor TrackerTest to remove withConsecutive method
The PHPUnit's InvocationMocker::withConsecutive() has been deprecated. Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
1 parent 2722ea7 commit 19762db

2 files changed

Lines changed: 9 additions & 12 deletions

File tree

psalm-baseline.xml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<files psalm-version="5.7.4@c46eccda769925073b8f65d66c4a3a7dc5d440b1">
2+
<files psalm-version="5.7.5@5390c212bab06ee230c8720c2e9c54b823db00c8">
33
<file src="libraries/classes/Advisory/Advisor.php">
44
<MixedArgument>
55
<code>$matches[1]</code>
@@ -18344,9 +18344,6 @@
1834418344
</MixedInferredReturnType>
1834518345
</file>
1834618346
<file src="test/classes/TrackerTest.php">
18347-
<DeprecatedMethod>
18348-
<code>withConsecutive</code>
18349-
</DeprecatedMethod>
1835018347
<MixedInferredReturnType>
1835118348
<code>array</code>
1835218349
<code>array</code>

test/classes/TrackerTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -241,14 +241,14 @@ public function testCreateVersion(): void
241241
->with('pma_test', 'pma_tbl')
242242
->will($this->returnValue($getIndexesResult));
243243

244-
$dbi->expects($this->exactly(3))
245-
->method('tryQuery')
246-
->withConsecutive(
247-
["SHOW TABLE STATUS FROM `pma_test` WHERE Name = 'pma_tbl'"],
248-
['USE `pma_test`'],
249-
['SHOW CREATE TABLE `pma_test`.`pma_tbl`']
250-
)
251-
->willReturnOnConsecutiveCalls($resultStub, $resultStub, $resultStub);
244+
$showTableStatusQuery = 'SHOW TABLE STATUS FROM `pma_test` WHERE Name = \'pma_tbl\'';
245+
$useStatement = 'USE `pma_test`';
246+
$showCreateTableQuery = 'SHOW CREATE TABLE `pma_test`.`pma_tbl`';
247+
$dbi->expects($this->exactly(3))->method('tryQuery')->willReturnMap([
248+
[$showTableStatusQuery, Connection::TYPE_USER, DatabaseInterface::QUERY_BUFFERED, true, $resultStub],
249+
[$useStatement, Connection::TYPE_USER, DatabaseInterface::QUERY_BUFFERED, true, $resultStub],
250+
[$showCreateTableQuery, Connection::TYPE_USER, DatabaseInterface::QUERY_BUFFERED, true, $resultStub],
251+
]);
252252

253253
$dbi->expects($this->any())->method('query')
254254
->will($this->returnValue($resultStub));

0 commit comments

Comments
 (0)