From 897ce711a84734980aef595feb5c917471dc47cf Mon Sep 17 00:00:00 2001 From: Sean Fisher Date: Fri, 13 Sep 2024 15:40:45 -0400 Subject: [PATCH] Fixing tests --- src/mantle/support/traits/trait-enumerates-values.php | 2 +- tests/Console/generators/PrinterTest.php | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/mantle/support/traits/trait-enumerates-values.php b/src/mantle/support/traits/trait-enumerates-values.php index 132aa144a..a038d7c70 100644 --- a/src/mantle/support/traits/trait-enumerates-values.php +++ b/src/mantle/support/traits/trait-enumerates-values.php @@ -663,7 +663,7 @@ public function reject( $callback = true ) { return $this->filter( fn ( $value, $key ) => $use_as_callable ? ! $callback( $value, $key ) - : $value !== $callback + : $value != $callback // phpcs:ignore Universal.Operators.StrictComparisons.LooseNotEqual, WordPress.PHP.StrictComparisons.LooseComparison ); } diff --git a/tests/Console/generators/PrinterTest.php b/tests/Console/generators/PrinterTest.php index 4b9b8bf5e..9e5d91dc3 100644 --- a/tests/Console/generators/PrinterTest.php +++ b/tests/Console/generators/PrinterTest.php @@ -72,7 +72,7 @@ public function test_make_function() { ->addComment( '' ) // For some reason these rules need to be disabled by the generated code // doesn't have any issues. - ->addComment( 'phpcs:disable WordPress.WhiteSpace.PrecisionAlignment.Found' ) + ->addComment( 'phpcs:disable WordPress.WhiteSpace.PrecisionAlignment.Found, Universal.WhiteSpace.PrecisionAlignment.Found' ) ->addComment( 'phpcs:disable Generic.WhiteSpace.ScopeIndent.Incorrect' ) ->addComment( '' ) ->addComment( '@package App' ) @@ -112,9 +112,10 @@ protected function lint_code( PhpFile $file, string $file_name ) { if ( 0 !== $exit_code ) { echo "Output from phpcs:\n"; dump( $output ); + echo "File output:\n"; + dump( $code ); } $this->assertEquals( 0, $exit_code, 'phpcs exit code should be 0 for no errors.' ); - } }