File tree Expand file tree Collapse file tree 3 files changed +15
-3
lines changed
Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -16,12 +16,14 @@ function assert_regex( $regex, $actual ) {
1616}
1717
1818function assert_equals ( $ expected , $ actual ) {
19+ // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison -- Deliberate loose comparison.
1920 if ( $ expected != $ actual ) {
2021 throw new Exception ( 'Actual value: ' . var_export ( $ actual , true ) );
2122 }
2223}
2324
2425function assert_not_equals ( $ expected , $ actual ) {
26+ // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison -- Deliberate loose comparison.
2527 if ( $ expected == $ actual ) {
2628 throw new Exception ( 'Actual value: ' . var_export ( $ actual , true ) );
2729 }
Original file line number Diff line number Diff line change 11<?php
2-
3- /*
2+ /**
43 * This file is copied as amu-plugin into new WP installs to reroute normal
54 * mails into log entries.
65 */
76
7+ /**
8+ * Replace WP native pluggable wp_mail function for test purposes.
9+ *
10+ * @param string $to Email address.
11+ *
12+ * @phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound -- WP native function.
13+ */
814function wp_mail ( $ to ) {
915 // Log for testing purposes
1016 WP_CLI ::log ( "WP-CLI test suite: Sent email to {$ to }. " );
1117}
12-
18+ // phpcs:enable
Original file line number Diff line number Diff line change 11<?php
22define ( 'WP_CLI ' , true );
33define ( 'WP_CLI_TESTS_ROOT ' , dirname ( __DIR__ ) );
4+
5+ // These constants are actively used by dependent projects, renaming them would be a BC-break.
6+ // phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedConstantFound
47define (
58 'VENDOR_DIR ' ,
69 file_exists ( WP_CLI_TESTS_ROOT . '/vendor/autoload.php ' )
710 ? WP_CLI_TESTS_ROOT . '/vendor '
811 : WP_CLI_TESTS_ROOT . '/../.. '
912);
1013define ( 'PACKAGE_ROOT ' , VENDOR_DIR . '/.. ' );
14+ // phpcs:enable
1115
1216define (
1317 'WP_CLI_ROOT ' ,
You can’t perform that action at this time.
0 commit comments