Skip to content

Commit

Permalink
[11.x] Fix expected/actual argument order for test assertion (#52084)
Browse files Browse the repository at this point in the history
* Fix expected/actual argument order for test assertion

* Fix test

* Fix test
  • Loading branch information
riesjart authored Jul 10, 2024
1 parent 68e88bb commit 4fafdd9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ public function expectsDatabaseQueryCount($expected, $connection = null)

$this->beforeApplicationDestroyed(function () use (&$actual, $expected, $connectionInstance) {
$this->assertSame(
$actual,
$expected,
$actual,
"Expected {$expected} database queries on the [{$connectionInstance->getName()}] connection. {$actual} occurred."
);
});
Expand Down
4 changes: 2 additions & 2 deletions tests/Foundation/FoundationInteractsWithDatabaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ public function testExpectsDatabaseQueryCount()
$case->tearDown();
$this->fail();
} catch (ExpectationFailedException $e) {
$this->assertSame("Expected 3 database queries on the [testing] connection. 0 occurred.\nFailed asserting that 3 is identical to 0.", $e->getMessage());
$this->assertSame("Expected 3 database queries on the [testing] connection. 0 occurred.\nFailed asserting that 0 is identical to 3.", $e->getMessage());
}

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

$case = new class('foo') extends TestingTestCase
Expand Down

0 comments on commit 4fafdd9

Please sign in to comment.