diff --git a/tests/_files/bar.txt b/tests/_files/bar.txt new file mode 100644 index 00000000000..5acdde49d10 --- /dev/null +++ b/tests/_files/bar.txt @@ -0,0 +1 @@ +Test for compare file diff --git a/tests/_files/foo.txt b/tests/_files/foo.txt new file mode 100644 index 00000000000..0fdeb064721 --- /dev/null +++ b/tests/_files/foo.txt @@ -0,0 +1 @@ +Test file for compare diff --git a/tests/unit/Framework/AssertTest.php b/tests/unit/Framework/AssertTest.php index e44984edbd4..81fd17f31c9 100644 --- a/tests/unit/Framework/AssertTest.php +++ b/tests/unit/Framework/AssertTest.php @@ -1570,6 +1570,17 @@ public function testAssertStringNotMatchesFormatFile(): void $this->assertStringNotMatchesFormatFile(TEST_FILES_PATH . 'expectedFileFormat.txt', "FOO\n"); } + public function testAssertFileEqualsCanonicalizing(): void + { + $this->assertFileEqualsCanonicalizing(TEST_FILES_PATH . 'foo.txt', TEST_FILES_PATH . 'foo.txt'); + + $this->assertFileEqualsCanonicalizing(TEST_FILES_PATH . 'foo.txt', TEST_FILES_PATH . 'bar.txt'); + + $this->expectException(AssertionFailedError::class); + + $this->assertFileEqualsCanonicalizing(TEST_FILES_PATH . 'foo.txt', TEST_FILES_PATH . 'foo.xml'); + } + public function testStringsCanBeComparedForEqualityIgnoringCase(): void { $this->assertEqualsIgnoringCase('a', 'A');