Skip to content

Commit

Permalink
Refactor test
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Jan 13, 2024
1 parent d981ece commit 7e7adbd
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 32 deletions.
32 changes: 0 additions & 32 deletions tests/unit/Framework/Assert/AssertNotEqualsTest.php

This file was deleted.

18 changes: 18 additions & 0 deletions tests/unit/Framework/Constraint/LogicalNotTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
*/
namespace PHPUnit\Framework\Constraint;

use PHPUnit\Framework\Assert;
use PHPUnit\Framework\ExpectationFailedException;

/**
* @small
*/
Expand Down Expand Up @@ -71,4 +74,19 @@ public function testNegate(string $input, string $expected): void
{
$this->assertSame($expected, LogicalNot::negate($input));
}

/**
* @testdox LogicalNot(IsEqual('test contains something')) is handled correctly
*
* @ticket https://github.com/sebastianbergmann/phpunit/issues/5516
*/
public function testForNotEqualsWithStringThatContainsContains(): void
{
$constraint = new LogicalNot(new IsEqual('test contains something'));

$this->expectException(ExpectationFailedException::class);
$this->expectExceptionMessage("Failed asserting that 'test contains something' is not equal to 'test contains something'.");

Assert::assertThat('test contains something', $constraint);
}
}

0 comments on commit 7e7adbd

Please sign in to comment.