We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c69b2fa commit b52516dCopy full SHA for b52516d
1 file changed
tests/unit/Framework/Assert/AssertNotEqualsTest.php
@@ -2,13 +2,22 @@
2
3
namespace PHPUnit\Framework;
4
5
+use PHPUnit\Framework\Constraint\IsEqual;
6
+use PHPUnit\Framework\Constraint\LogicalNot;
7
+
8
class AssertNotEqualsTest extends TestCase
9
{
10
public function testConfusingMessagesForLogicalNot()
11
12
+ $expectedMessage = "Failed asserting that 'test contains something' is not equal to 'test contains something'.";
13
$a = 'test contains something';
14
$b = 'test contains something';
-
- $this->assertNotEquals($b, $a);
15
+ $constraint = new LogicalNot(new IsEqual($a));
16
+ try {
17
+ Assert::assertThat($b, $constraint);
18
+ } catch (\Exception $e) {
19
+ $actualMessage = $e->getMessage();
20
+ $this->assertSame($expectedMessage, $actualMessage);
21
+ }
22
}
23
0 commit comments