Skip to content

Commit

Permalink
run psalm and cs-fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
marac19901990 authored and sebastianbergmann committed Jan 13, 2024
1 parent c97236b commit f333518
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/Framework/Constraint/Operator/LogicalNot.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public static function negate(string $string): string
];

preg_match('/(\'[\w\W]*\')([\w\W]*)("[\w\W]*")/i', $string, $matches);

if (count($matches) === 0) {
preg_match('/(\'[\w\W]*\')([\w\W]*)(\'[\w\W]*\')/i', $string, $matches);
}
Expand Down
23 changes: 16 additions & 7 deletions tests/unit/Framework/Assert/AssertNotEqualsTest.php
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);
}
Expand Down

0 comments on commit f333518

Please sign in to comment.