• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Yoast / PHPUnit-Polyfills / 16579531037

28 Jul 2025 08:25PM UTC coverage: 63.368% (-32.5%) from 95.846%
16579531037

push

github

jrfnl
Merge branch '1.x' into 2.x

365 of 576 relevant lines covered (63.37%)

17.41 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Polyfills/AssertFileEqualsSpecializations.php
1
<?php
2

3
namespace Yoast\PHPUnitPolyfills\Polyfills;
4

5
/**
6
 * Polyfill the `Assert::assertFileEqualsCanonicalizing()`, `Assert::assertFileEqualsIgnoringCase()`,
7
 * `Assert::assertStringEqualsFileCanonicalizing()`, `Assert::assertStringEqualsFileIgnoringCase()`,
8
 * `Assert::assertFileNotEqualsCanonicalizing()`, `Assert::assertFileNotEqualsIgnoringCase()`,
9
 * `Assert::assertStringNotEqualsFileCanonicalizing()` and `Assert::assertStringNotEqualsFileIgnoringCase()`
10
 * as alternative to using `Assert::assertFileEquals()` etc. with optional parameters
11
 *
12
 * Introduced in PHPUnit 8.5.0.
13
 * Use of Assert::assertFileEquals() and Assert::assertFileNotEquals() with these optional parameters was
14
 * deprecated in PHPUnit 8.5.0 and removed in PHPUnit 9.0.0.
15
 *
16
 * @link https://github.com/sebastianbergmann/phpunit/issues/3949
17
 * @link https://github.com/sebastianbergmann/phpunit/issues/3951
18
 *
19
 * @since 0.1.0
20
 */
21
trait AssertFileEqualsSpecializations {
22

23
        /**
24
         * Asserts that the contents of one file is equal to the contents of another
25
         * file (canonicalizing).
26
         *
27
         * @param string $expected Path to file with expected content.
28
         * @param string $actual   Path to file with actual content.
29
         * @param string $message  Optional failure message to display.
30
         *
31
         * @return void
32
         */
33
        final public static function assertFileEqualsCanonicalizing( $expected, $actual, $message = '' ) {
×
34
                static::assertFileEquals( $expected, $actual, $message, true );
×
35
        }
36

37
        /**
38
         * Asserts that the contents of one file is equal to the contents of another
39
         * file (ignoring case).
40
         *
41
         * @param string $expected Path to file with expected content.
42
         * @param string $actual   Path to file with actual content.
43
         * @param string $message  Optional failure message to display.
44
         *
45
         * @return void
46
         */
47
        final public static function assertFileEqualsIgnoringCase( $expected, $actual, $message = '' ) {
×
48
                static::assertFileEquals( $expected, $actual, $message, false, true );
×
49
        }
50

51
        /**
52
         * Asserts that the contents of one file is not equal to the contents of another
53
         * file (canonicalizing).
54
         *
55
         * @param string $expected Path to file with expected content.
56
         * @param string $actual   Path to file with actual content.
57
         * @param string $message  Optional failure message to display.
58
         *
59
         * @return void
60
         */
61
        final public static function assertFileNotEqualsCanonicalizing( $expected, $actual, $message = '' ) {
×
62
                static::assertFileNotEquals( $expected, $actual, $message, true );
×
63
        }
64

65
        /**
66
         * Asserts that the contents of one file is not equal to the contents of another
67
         * file (ignoring case).
68
         *
69
         * @param string $expected Path to file with expected content.
70
         * @param string $actual   Path to file with actual content.
71
         * @param string $message  Optional failure message to display.
72
         *
73
         * @return void
74
         */
75
        final public static function assertFileNotEqualsIgnoringCase( $expected, $actual, $message = '' ) {
×
76
                static::assertFileNotEquals( $expected, $actual, $message, false, true );
×
77
        }
78

79
        /**
80
         * Asserts that the contents of a string is equal to the contents of
81
         * a file (canonicalizing).
82
         *
83
         * @param string $expectedFile Path to file with expected content.
84
         * @param string $actualString Actual content.
85
         * @param string $message      Optional failure message to display.
86
         *
87
         * @return void
88
         */
89
        final public static function assertStringEqualsFileCanonicalizing( $expectedFile, $actualString, $message = '' ) {
×
90
                static::assertStringEqualsFile( $expectedFile, $actualString, $message, true );
×
91
        }
92

93
        /**
94
         * Asserts that the contents of a string is equal to the contents of
95
         * a file (ignoring case).
96
         *
97
         * @param string $expectedFile Path to file with expected content.
98
         * @param string $actualString Actual content.
99
         * @param string $message      Optional failure message to display.
100
         *
101
         * @return void
102
         */
103
        final public static function assertStringEqualsFileIgnoringCase( $expectedFile, $actualString, $message = '' ) {
×
104
                static::assertStringEqualsFile( $expectedFile, $actualString, $message, false, true );
×
105
        }
106

107
        /**
108
         * Asserts that the contents of a string is not equal to the contents of
109
         * a file (canonicalizing).
110
         *
111
         * @param string $expectedFile Path to file with expected content.
112
         * @param string $actualString Actual content.
113
         * @param string $message      Optional failure message to display.
114
         *
115
         * @return void
116
         */
117
        final public static function assertStringNotEqualsFileCanonicalizing( $expectedFile, $actualString, $message = '' ) {
×
118
                static::assertStringNotEqualsFile( $expectedFile, $actualString, $message, true );
×
119
        }
120

121
        /**
122
         * Asserts that the contents of a string is not equal to the contents of
123
         * a file (ignoring case).
124
         *
125
         * @param string $expectedFile Path to file with expected content.
126
         * @param string $actualString Actual content.
127
         * @param string $message      Optional failure message to display.
128
         *
129
         * @return void
130
         */
131
        final public static function assertStringNotEqualsFileIgnoringCase( $expectedFile, $actualString, $message = '' ) {
×
132
                static::assertStringNotEqualsFile( $expectedFile, $actualString, $message, false, true );
×
133
        }
134
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc