-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a400f5d
commit 3802132
Showing
2 changed files
with
17 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,30 @@ | ||
<?php | ||
|
||
<?php declare(strict_types=1); | ||
/* | ||
* This file is part of PHPUnit. | ||
* | ||
* (c) Sebastian Bergmann <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
namespace PHPUnit\Framework; | ||
|
||
use Exception; | ||
use PHPUnit\Framework\Constraint\IsEqual; | ||
use PHPUnit\Framework\Constraint\LogicalNot; | ||
|
||
class AssertNotEqualsTest extends TestCase | ||
{ | ||
public function testConfusingMessagesForLogicalNot() | ||
public function testConfusingMessagesForLogicalNot(): void | ||
{ | ||
$expectedMessage = "Failed asserting that 'test contains something' is not equal to 'test contains something'."; | ||
$a = 'test contains something'; | ||
$b = 'test contains something'; | ||
$constraint = new LogicalNot(new IsEqual($a)); | ||
$a = 'test contains something'; | ||
$b = 'test contains something'; | ||
$constraint = new LogicalNot(new IsEqual($a)); | ||
|
||
try { | ||
Assert::assertThat($b, $constraint); | ||
} catch (\Exception $e) { | ||
} catch (Exception $e) { | ||
$actualMessage = $e->getMessage(); | ||
$this->assertSame($expectedMessage, $actualMessage); | ||
} | ||
|