From e583a5974ec87fa9e415e6aad5c92a35d4fa4045 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Tue, 31 Oct 2023 01:40:40 +0100 Subject: [PATCH] Tests: add abstract `NonSniffTestCase` class ... for tests which are directly not related to sniffs, nor need a code sample, but which do need a functioning PHPCS File object, for instance to mock retrieve the file name from the File object or mock retrieve a base path from the Config object within the File object. Note: this test case will likely be moved to PHPCSUtils at some point in the future, though it may be a while as in its current set up, the class needs a PHP 7.0 minimum. --- Yoast/Tests/NonSniffTestCase.php | 44 ++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 Yoast/Tests/NonSniffTestCase.php diff --git a/Yoast/Tests/NonSniffTestCase.php b/Yoast/Tests/NonSniffTestCase.php new file mode 100644 index 00000000..0c9035be --- /dev/null +++ b/Yoast/Tests/NonSniffTestCase.php @@ -0,0 +1,44 @@ +config = $config; + + return $phpcsFile; + } +}