Skip to content

Commit

Permalink
Merge branch '10.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Jan 13, 2024
2 parents 67cfab0 + 9e38c8f commit 855919d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/_files/bar.txt
@@ -0,0 +1 @@
Voulez-vous un café?
1 change: 1 addition & 0 deletions tests/_files/foo.txt
@@ -0,0 +1 @@
Voulez-vous un café?
23 changes: 23 additions & 0 deletions tests/unit/Framework/AssertTest.php
Expand Up @@ -1621,6 +1621,29 @@ public function testAssertStringNotMatchesFormatFile(): void
$this->assertStringNotMatchesFormatFile(TEST_FILES_PATH . 'expectedFileFormat.txt', "FOO\n");
}

public function testAssertFileEqualsCanonicalizing(): void
{
$this->assertFileNotEquals(TEST_FILES_PATH . 'foo.txt', TEST_FILES_PATH . 'bar.txt');
$this->assertFileEqualsCanonicalizing(TEST_FILES_PATH . 'foo.txt', TEST_FILES_PATH . 'foo.txt');

$this->expectException(AssertionFailedError::class);

$this->assertFileEqualsCanonicalizing(TEST_FILES_PATH . 'foo.txt', TEST_FILES_PATH . 'foo.xml');
}

public function testAssertStringNotEqualsFileCanonicalizing(): void
{
$contents = file_get_contents(TEST_FILES_PATH . 'foo.xml');

$this->assertStringNotEqualsFileCanonicalizing(TEST_FILES_PATH . 'foo.xml', $contents . ' BAR');

$this->assertStringNotEqualsFileCanonicalizing(TEST_FILES_PATH . 'foo.xml', 'BAR');

$this->expectException(AssertionFailedError::class);

$this->assertStringNotEqualsFileCanonicalizing(TEST_FILES_PATH . 'foo.xml', $contents);
}

public function testStringsCanBeComparedForEqualityIgnoringCase(): void
{
$this->assertEqualsIgnoringCase('a', 'A');
Expand Down

0 comments on commit 855919d

Please sign in to comment.