Skip to content

Commit 4fafdd9

Browse files
authored
[11.x] Fix expected/actual argument order for test assertion (#52084)
* Fix expected/actual argument order for test assertion * Fix test * Fix test
1 parent 68e88bb commit 4fafdd9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Illuminate/Foundation/Testing/Concerns/InteractsWithDatabase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,8 @@ public function expectsDatabaseQueryCount($expected, $connection = null)
199199

200200
$this->beforeApplicationDestroyed(function () use (&$actual, $expected, $connectionInstance) {
201201
$this->assertSame(
202-
$actual,
203202
$expected,
203+
$actual,
204204
"Expected {$expected} database queries on the [{$connectionInstance->getName()}] connection. {$actual} occurred."
205205
);
206206
});

tests/Foundation/FoundationInteractsWithDatabaseTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ public function testExpectsDatabaseQueryCount()
392392
$case->tearDown();
393393
$this->fail();
394394
} catch (ExpectationFailedException $e) {
395-
$this->assertSame("Expected 3 database queries on the [testing] connection. 0 occurred.\nFailed asserting that 3 is identical to 0.", $e->getMessage());
395+
$this->assertSame("Expected 3 database queries on the [testing] connection. 0 occurred.\nFailed asserting that 0 is identical to 3.", $e->getMessage());
396396
}
397397

398398
$case = new class('foo') extends TestingTestCase
@@ -419,7 +419,7 @@ public function testExpectsDatabaseQueryCount()
419419
$case->tearDown();
420420
$this->fail();
421421
} catch (ExpectationFailedException $e) {
422-
$this->assertSame("Expected 3 database queries on the [testing] connection. 4 occurred.\nFailed asserting that 3 is identical to 4.", $e->getMessage());
422+
$this->assertSame("Expected 3 database queries on the [testing] connection. 4 occurred.\nFailed asserting that 4 is identical to 3.", $e->getMessage());
423423
}
424424

425425
$case = new class('foo') extends TestingTestCase

0 commit comments

Comments
 (0)