From 16b749a7ae7f030a64d1618c1ccae8f9a16cd6cf Mon Sep 17 00:00:00 2001 From: kenjis Date: Wed, 18 Oct 2023 11:01:51 +0900 Subject: [PATCH 1/4] refactor!: remove deprecated Test classes/trait --- system/Test/CIDatabaseTestCase.php | 24 -- system/Test/ControllerResponse.php | 99 -------- system/Test/ControllerTester.php | 293 --------------------- system/Test/FeatureResponse.php | 25 -- system/Test/FeatureTestCase.php | 392 ----------------------------- 5 files changed, 833 deletions(-) delete mode 100644 system/Test/CIDatabaseTestCase.php delete mode 100644 system/Test/ControllerResponse.php delete mode 100644 system/Test/ControllerTester.php delete mode 100644 system/Test/FeatureResponse.php delete mode 100644 system/Test/FeatureTestCase.php diff --git a/system/Test/CIDatabaseTestCase.php b/system/Test/CIDatabaseTestCase.php deleted file mode 100644 index 8e25c3782dbb..000000000000 --- a/system/Test/CIDatabaseTestCase.php +++ /dev/null @@ -1,24 +0,0 @@ - - * - * For the full copyright and license information, please view - * the LICENSE file that was distributed with this source code. - */ - -namespace CodeIgniter\Test; - -/** - * CIDatabaseTestCase - * - * Use DatabaseTestTrait instead. - * - * @deprecated 4.1.2 - */ -abstract class CIDatabaseTestCase extends CIUnitTestCase -{ - use DatabaseTestTrait; -} diff --git a/system/Test/ControllerResponse.php b/system/Test/ControllerResponse.php deleted file mode 100644 index 2a90e4dd0bb9..000000000000 --- a/system/Test/ControllerResponse.php +++ /dev/null @@ -1,99 +0,0 @@ - - * - * For the full copyright and license information, please view - * the LICENSE file that was distributed with this source code. - */ - -namespace CodeIgniter\Test; - -use CodeIgniter\HTTP\ResponseInterface; -use Config\Services; - -/** - * Testable response from a controller - * - * @deprecated Use TestResponse directly - * - * @codeCoverageIgnore - */ -class ControllerResponse extends TestResponse -{ - /** - * The message payload. - * - * @var string - * - * @deprecated Use $response->getBody() instead - */ - protected $body; - - /** - * DOM for the body. - * - * @var DOMParser - * - * @deprecated Use $domParser instead - */ - protected $dom; - - /** - * Maintains the deprecated $dom property. - */ - public function __construct() - { - parent::__construct(Services::response()); - - $this->dom = &$this->domParser; - } - - /** - * Sets the response. - * - * @return $this - * - * @deprecated Will revert to parent::setResponse() in a future release (no $body updates) - */ - public function setResponse(ResponseInterface $response) - { - parent::setResponse($response); - - $this->body = $response->getBody() ?? ''; - - return $this; - } - - /** - * Sets the body and updates the DOM. - * - * @return $this - * - * @deprecated Use response()->setBody() instead - */ - public function setBody(string $body) - { - $this->body = $body; - - if ($body !== '') { - $this->domParser->withString($body); - } - - return $this; - } - - /** - * Retrieve the body. - * - * @return string - * - * @deprecated Use response()->getBody() instead - */ - public function getBody() - { - return $this->body; - } -} diff --git a/system/Test/ControllerTester.php b/system/Test/ControllerTester.php deleted file mode 100644 index c01e6a8ba2f3..000000000000 --- a/system/Test/ControllerTester.php +++ /dev/null @@ -1,293 +0,0 @@ - - * - * For the full copyright and license information, please view - * the LICENSE file that was distributed with this source code. - */ - -namespace CodeIgniter\Test; - -use CodeIgniter\Controller; -use CodeIgniter\HTTP\IncomingRequest; -use CodeIgniter\HTTP\ResponseInterface; -use CodeIgniter\HTTP\URI; -use Config\App; -use Config\Services; -use InvalidArgumentException; -use Psr\Log\LoggerInterface; -use Throwable; - -/** - * ControllerTester Trait - * - * Provides features that make testing controllers simple and fluent. - * - * Example: - * - * $this->withRequest($request) - * ->withResponse($response) - * ->withURI($uri) - * ->withBody($body) - * ->controller('App\Controllers\Home') - * ->execute('methodName'); - * - * @deprecated Use ControllerTestTrait instead - * - * @codeCoverageIgnore - */ -trait ControllerTester -{ - /** - * Controller configuration. - * - * @var App - */ - protected $appConfig; - - /** - * Request. - * - * @var IncomingRequest - */ - protected $request; - - /** - * Response. - * - * @var ResponseInterface - */ - protected $response; - - /** - * Message logger. - * - * @var LoggerInterface - */ - protected $logger; - - /** - * Initialized controller. - * - * @var Controller - */ - protected $controller; - - /** - * URI of this request. - * - * @var string - */ - protected $uri = 'http://example.com'; - - /** - * Request or response body. - * - * @var string|null - */ - protected $body; - - /** - * Initializes required components. - */ - protected function setUpControllerTester(): void - { - if (empty($this->appConfig)) { - $this->appConfig = config(App::class); - } - - if (! $this->uri instanceof URI) { - $this->uri = Services::uri($this->appConfig->baseURL ?? 'http://example.com/', false); - } - - if (empty($this->request)) { - // Do some acrobatics so we can use the Request service with our own URI - $tempUri = Services::uri(); - Services::injectMock('uri', $this->uri); - - $this->withRequest(Services::incomingrequest($this->appConfig, false)->setBody($this->body)); - - // Restore the URI service - Services::injectMock('uri', $tempUri); - } - - if (empty($this->response)) { - $this->response = Services::response($this->appConfig, false); - } - - if (empty($this->logger)) { - $this->logger = Services::logger(); - } - } - - /** - * Loads the specified controller, and generates any needed dependencies. - * - * @return mixed - */ - public function controller(string $name) - { - if (! class_exists($name)) { - throw new InvalidArgumentException('Invalid Controller: ' . $name); - } - - $this->controller = new $name(); - $this->controller->initController($this->request, $this->response, $this->logger); - - return $this; - } - - /** - * Runs the specified method on the controller and returns the results. - * - * @param array $params - * - * @return ControllerResponse - * - * @throws InvalidArgumentException - */ - public function execute(string $method, ...$params) - { - if (! method_exists($this->controller, $method) || ! is_callable([$this->controller, $method])) { - throw new InvalidArgumentException('Method does not exist or is not callable in controller: ' . $method); - } - - // The URL helper is always loaded by the system - // so ensure it's available. - helper('url'); - - $result = (new ControllerResponse()) - ->setRequest($this->request) - ->setResponse($this->response); - - $response = null; - - try { - ob_start(); - - $response = $this->controller->{$method}(...$params); - } catch (Throwable $e) { - $code = $e->getCode(); - - // If code is not a valid HTTP status then assume there is an error - if ($code < 100 || $code >= 600) { - throw $e; - } - - $result->response()->setStatusCode($code); - } finally { - $output = ob_get_clean(); - - // If the controller returned a response, use it - if (isset($response) && $response instanceof ResponseInterface) { - $result->setResponse($response); - } - - // check if controller returned a view rather than echoing it - if (is_string($response)) { - $output = $response; - $result->response()->setBody($output); - $result->setBody($output); - } elseif (! empty($response) && ! empty($response->getBody())) { - $result->setBody($response->getBody()); - } else { - $result->setBody(''); - } - } - - // If not response code has been sent, assume a success - if (empty($result->response()->getStatusCode())) { - $result->response()->setStatusCode(200); - } - - return $result; - } - - /** - * Set controller's config, with method chaining. - * - * @param mixed $appConfig - * - * @return mixed - */ - public function withConfig($appConfig) - { - $this->appConfig = $appConfig; - - return $this; - } - - /** - * Set controller's request, with method chaining. - * - * @param mixed $request - * - * @return mixed - */ - public function withRequest($request) - { - $this->request = $request; - - // Make sure it's available for other classes - Services::injectMock('request', $request); - - return $this; - } - - /** - * Set controller's response, with method chaining. - * - * @param mixed $response - * - * @return mixed - */ - public function withResponse($response) - { - $this->response = $response; - - return $this; - } - - /** - * Set controller's logger, with method chaining. - * - * @param mixed $logger - * - * @return mixed - */ - public function withLogger($logger) - { - $this->logger = $logger; - - return $this; - } - - /** - * Set the controller's URI, with method chaining. - * - * @return mixed - */ - public function withUri(string $uri) - { - $this->uri = new URI($uri); - - return $this; - } - - /** - * Set the method's body, with method chaining. - * - * @param string|null $body - * - * @return mixed - */ - public function withBody($body) - { - $this->body = $body; - - return $this; - } -} diff --git a/system/Test/FeatureResponse.php b/system/Test/FeatureResponse.php deleted file mode 100644 index 971f41c5b6e4..000000000000 --- a/system/Test/FeatureResponse.php +++ /dev/null @@ -1,25 +0,0 @@ - - * - * For the full copyright and license information, please view - * the LICENSE file that was distributed with this source code. - */ - -namespace CodeIgniter\Test; - -/** - * Assertions for a response - * - * @deprecated Use TestResponse directly - */ -class FeatureResponse extends TestResponse -{ - /** - * @deprecated Will be protected in a future release, use response() instead - */ - public $response; -} diff --git a/system/Test/FeatureTestCase.php b/system/Test/FeatureTestCase.php deleted file mode 100644 index c94cf926ca89..000000000000 --- a/system/Test/FeatureTestCase.php +++ /dev/null @@ -1,392 +0,0 @@ - - * - * For the full copyright and license information, please view - * the LICENSE file that was distributed with this source code. - */ - -namespace CodeIgniter\Test; - -use CodeIgniter\Events\Events; -use CodeIgniter\HTTP\CLIRequest; -use CodeIgniter\HTTP\Exceptions\RedirectException; -use CodeIgniter\HTTP\IncomingRequest; -use CodeIgniter\HTTP\URI; -use CodeIgniter\HTTP\UserAgent; -use Config\App; -use Config\Services; -use Exception; -use ReflectionException; - -/** - * Class FeatureTestCase - * - * Provides a base class with the trait for doing full HTTP testing - * against your application. - * - * @no-final - * - * @deprecated Use FeatureTestTrait instead - * - * @codeCoverageIgnore - * - * @internal - */ -class FeatureTestCase extends CIUnitTestCase -{ - use DatabaseTestTrait; - - /** - * Sets a RouteCollection that will override - * the application's route collection. - * - * Example routes: - * [ - * ['get', 'home', 'Home::index'] - * ] - * - * @return $this - */ - protected function withRoutes(?array $routes = null) - { - $collection = Services::routes(); - - if ($routes !== null) { - $collection->resetRoutes(); - - foreach ($routes as $route) { - $collection->{$route[0]}($route[1], $route[2]); - } - } - - $this->routes = $collection; - - return $this; - } - - /** - * Sets any values that should exist during this session. - * - * @param array|null $values Array of values, or null to use the current $_SESSION - * - * @return $this - */ - public function withSession(?array $values = null) - { - $this->session = $values ?? $_SESSION; - - return $this; - } - - /** - * Set request's headers - * - * Example of use - * withHeaders([ - * 'Authorization' => 'Token' - * ]) - * - * @param array $headers Array of headers - * - * @return $this - */ - public function withHeaders(array $headers = []) - { - $this->headers = $headers; - - return $this; - } - - /** - * Set the format the request's body should have. - * - * @param string $format The desired format. Currently supported formats: xml, json - * - * @return $this - */ - public function withBodyFormat(string $format) - { - $this->bodyFormat = $format; - - return $this; - } - - /** - * Set the raw body for the request - * - * @param mixed $body - * - * @return $this - */ - public function withBody($body) - { - $this->requestBody = $body; - - return $this; - } - - /** - * Don't run any events while running this test. - * - * @return $this - */ - public function skipEvents() - { - Events::simulate(true); - - return $this; - } - - /** - * Calls a single URI, executes it, and returns a FeatureResponse - * instance that can be used to run many assertions against. - * - * @return FeatureResponse - */ - public function call(string $method, string $path, ?array $params = null) - { - $buffer = \ob_get_level(); - - // Clean up any open output buffers - // not relevant to unit testing - if (\ob_get_level() > 0 && (! isset($this->clean) || $this->clean === true)) { - \ob_end_clean(); // @codeCoverageIgnore - } - - // Simulate having a blank session - $_SESSION = []; - $_SERVER['REQUEST_METHOD'] = $method; - - $request = $this->setupRequest($method, $path); - $request = $this->setupHeaders($request); - $request = $this->populateGlobals($method, $request, $params); - $request = $this->setRequestBody($request); - - // Initialize the RouteCollection - if (! $routes = $this->routes) { - $routes = Services::routes()->loadRoutes(); - } - - $routes->setHTTPVerb($method); - - // Make sure any other classes that might call the request - // instance get the right one. - Services::injectMock('request', $request); - - // Make sure filters are reset between tests - Services::injectMock('filters', Services::filters(null, false)); - - $response = $this->app - ->setContext('web') - ->setRequest($request) - ->run($routes, true); - - $output = \ob_get_contents(); - if (empty($response->getBody()) && ! empty($output)) { - $response->setBody($output); - } - - // Reset directory if it has been set - Services::router()->setDirectory(null); - - // Ensure the output buffer is identical so no tests are risky - while (\ob_get_level() > $buffer) { - \ob_end_clean(); // @codeCoverageIgnore - } - - while (\ob_get_level() < $buffer) { - \ob_start(); // @codeCoverageIgnore - } - - return new FeatureResponse($response); - } - - /** - * Performs a GET request. - * - * @return FeatureResponse - * - * @throws Exception - * @throws RedirectException - */ - public function get(string $path, ?array $params = null) - { - return $this->call('get', $path, $params); - } - - /** - * Performs a POST request. - * - * @return FeatureResponse - * - * @throws Exception - * @throws RedirectException - */ - public function post(string $path, ?array $params = null) - { - return $this->call('post', $path, $params); - } - - /** - * Performs a PUT request - * - * @return FeatureResponse - * - * @throws Exception - * @throws RedirectException - */ - public function put(string $path, ?array $params = null) - { - return $this->call('put', $path, $params); - } - - /** - * Performss a PATCH request - * - * @return FeatureResponse - * - * @throws Exception - * @throws RedirectException - */ - public function patch(string $path, ?array $params = null) - { - return $this->call('patch', $path, $params); - } - - /** - * Performs a DELETE request. - * - * @return FeatureResponse - * - * @throws Exception - * @throws RedirectException - */ - public function delete(string $path, ?array $params = null) - { - return $this->call('delete', $path, $params); - } - - /** - * Performs an OPTIONS request. - * - * @return FeatureResponse - * - * @throws Exception - * @throws RedirectException - */ - public function options(string $path, ?array $params = null) - { - return $this->call('options', $path, $params); - } - - /** - * Setup a Request object to use so that CodeIgniter - * won't try to auto-populate some of the items. - */ - protected function setupRequest(string $method, ?string $path = null): IncomingRequest - { - $config = config(App::class); - $uri = new URI(rtrim($config->baseURL, '/') . '/' . trim($path, '/ ')); - - $request = new IncomingRequest($config, clone $uri, null, new UserAgent()); - $request->uri = $uri; - - $request->setMethod($method); - $request->setProtocolVersion('1.1'); - - if ($config->forceGlobalSecureRequests) { - $_SERVER['HTTPS'] = 'test'; - } - - return $request; - } - - /** - * Setup the custom request's headers - * - * @return IncomingRequest - */ - protected function setupHeaders(IncomingRequest $request) - { - foreach ($this->headers as $name => $value) { - $request->setHeader($name, $value); - } - - return $request; - } - - /** - * Populates the data of our Request with "global" data - * relevant to the request, like $_POST data. - * - * Always populate the GET vars based on the URI. - * - * @param CLIRequest|IncomingRequest $request - * - * @return CLIRequest|IncomingRequest - * - * @throws ReflectionException - */ - protected function populateGlobals(string $method, $request, ?array $params = null) - { - // $params should set the query vars if present, - // otherwise set it from the URL. - $get = ! empty($params) && $method === 'get' - ? $params - : $this->getPrivateProperty($request->getUri(), 'query'); - - $request->setGlobal('get', $get); - if ($method !== 'get') { - $request->setGlobal($method, $params); - } - - $request->setGlobal('request', $params); - - $_SESSION = $this->session ?? []; - - return $request; - } - - /** - * Set the request's body formatted according to the value in $this->bodyFormat. - * This allows the body to be formatted in a way that the controller is going to - * expect as in the case of testing a JSON or XML API. - * - * @param CLIRequest|IncomingRequest $request - * @param array|null $params The parameters to be formatted and put in the body. If this is empty, it will get the - * what has been loaded into the request global of the request class. - * - * @return CLIRequest|IncomingRequest - */ - protected function setRequestBody($request, ?array $params = null) - { - if (isset($this->requestBody) && $this->requestBody !== '') { - $request->setBody($this->requestBody); - - return $request; - } - - if (isset($this->bodyFormat) && $this->bodyFormat !== '') { - if (empty($params)) { - $params = $request->fetchGlobal('request'); - } - $formatMime = ''; - if ($this->bodyFormat === 'json') { - $formatMime = 'application/json'; - } elseif ($this->bodyFormat === 'xml') { - $formatMime = 'application/xml'; - } - if (! empty($formatMime) && ! empty($params)) { - $formatted = Services::format()->getFormatter($formatMime)->format($params); - $request->setBody($formatted); - $request->setHeader('Content-Type', $formatMime); - } - } - - return $request; - } -} From 4f25d3b6a783fb74ac0385e08a2fa4c8778f0918 Mon Sep 17 00:00:00 2001 From: kenjis Date: Wed, 18 Oct 2023 11:04:57 +0900 Subject: [PATCH 2/4] docs: move section Others down --- user_guide_src/source/changelogs/v4.5.0.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/user_guide_src/source/changelogs/v4.5.0.rst b/user_guide_src/source/changelogs/v4.5.0.rst index efb5919fb0b7..27e6ea7cbc17 100644 --- a/user_guide_src/source/changelogs/v4.5.0.rst +++ b/user_guide_src/source/changelogs/v4.5.0.rst @@ -102,11 +102,6 @@ Filters - ``Router::$filterInfo`` - ``Router::getFilter()`` -Others ------- - -- **Config:** The deprecated ``CodeIgniter\Config\Config`` class has been removed. - Model ----- @@ -123,6 +118,11 @@ CodeIgniter - ``useSafeOutput()`` - ``setPath()`` +Others +------ + +- **Config:** The deprecated ``CodeIgniter\Config\Config`` class has been removed. + Enhancements ************ From 5f9b18b4c067644b319c01b28e76e26bd338ce24 Mon Sep 17 00:00:00 2001 From: kenjis Date: Wed, 18 Oct 2023 11:07:21 +0900 Subject: [PATCH 3/4] docs: add changelog --- user_guide_src/source/changelogs/v4.5.0.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/user_guide_src/source/changelogs/v4.5.0.rst b/user_guide_src/source/changelogs/v4.5.0.rst index 27e6ea7cbc17..5b8e22ac802f 100644 --- a/user_guide_src/source/changelogs/v4.5.0.rst +++ b/user_guide_src/source/changelogs/v4.5.0.rst @@ -118,6 +118,15 @@ CodeIgniter - ``useSafeOutput()`` - ``setPath()`` +Test +---- + +- ``CIDatabaseTestCase`` +- ``ControllerResponse`` +- ``ControllerTester`` +- ``FeatureResponse`` +- ``FeatureTestCase`` + Others ------ From 59b138aabd9cbb439b3a05fb089eff8b247edbd4 Mon Sep 17 00:00:00 2001 From: kenjis Date: Wed, 18 Oct 2023 11:17:50 +0900 Subject: [PATCH 4/4] chore: update phpstan-baseline --- phpstan-baseline.php | 180 ------------------------------------------- 1 file changed, 180 deletions(-) diff --git a/phpstan-baseline.php b/phpstan-baseline.php index a88718ddfaba..04effec5dc18 100644 --- a/phpstan-baseline.php +++ b/phpstan-baseline.php @@ -3271,81 +3271,6 @@ 'count' => 1, 'path' => __DIR__ . '/system/Session/SessionInterface.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#', - 'count' => 4, - 'path' => __DIR__ . '/system/Test/CIDatabaseTestCase.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\Test\\\\CIDatabaseTestCase\\:\\:clearInsertCache\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/Test/CIDatabaseTestCase.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\Test\\\\CIDatabaseTestCase\\:\\:dontSeeInDatabase\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/Test/CIDatabaseTestCase.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\Test\\\\CIDatabaseTestCase\\:\\:loadDependencies\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/Test/CIDatabaseTestCase.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\Test\\\\CIDatabaseTestCase\\:\\:migrateDatabase\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/Test/CIDatabaseTestCase.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\Test\\\\CIDatabaseTestCase\\:\\:regressDatabase\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/Test/CIDatabaseTestCase.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\Test\\\\CIDatabaseTestCase\\:\\:resetMigrationSeedCount\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/Test/CIDatabaseTestCase.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\Test\\\\CIDatabaseTestCase\\:\\:runSeeds\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/Test/CIDatabaseTestCase.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\Test\\\\CIDatabaseTestCase\\:\\:seeInDatabase\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/Test/CIDatabaseTestCase.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\Test\\\\CIDatabaseTestCase\\:\\:seeNumRecords\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/Test/CIDatabaseTestCase.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\Test\\\\CIDatabaseTestCase\\:\\:seed\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/Test/CIDatabaseTestCase.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\Test\\\\CIDatabaseTestCase\\:\\:setUpDatabase\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/Test/CIDatabaseTestCase.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\Test\\\\CIDatabaseTestCase\\:\\:setUpMigrate\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/Test/CIDatabaseTestCase.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\Test\\\\CIDatabaseTestCase\\:\\:setUpSeed\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/Test/CIDatabaseTestCase.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\Test\\\\CIDatabaseTestCase\\:\\:tearDownDatabase\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/Test/CIDatabaseTestCase.php', -]; $ignoreErrors[] = [ 'message' => '#^Method CodeIgniter\\\\Test\\\\CIUnitTestCase\\:\\:assertCloseEnough\\(\\) has no return type specified\\.$#', 'count' => 1, @@ -3436,111 +3361,6 @@ 'count' => 1, 'path' => __DIR__ . '/system/Test/Fabricator.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Assigning \'test\' directly on offset \'HTTPS\' of \\$_SERVER is discouraged\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/Test/FeatureTestCase.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Assigning string directly on offset \'REQUEST_METHOD\' of \\$_SERVER is discouraged\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/Test/FeatureTestCase.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#', - 'count' => 10, - 'path' => __DIR__ . '/system/Test/FeatureTestCase.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\Test\\\\FeatureTestCase\\:\\:clearInsertCache\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/Test/FeatureTestCase.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\Test\\\\FeatureTestCase\\:\\:dontSeeInDatabase\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/Test/FeatureTestCase.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\Test\\\\FeatureTestCase\\:\\:loadDependencies\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/Test/FeatureTestCase.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\Test\\\\FeatureTestCase\\:\\:migrateDatabase\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/Test/FeatureTestCase.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\Test\\\\FeatureTestCase\\:\\:regressDatabase\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/Test/FeatureTestCase.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\Test\\\\FeatureTestCase\\:\\:resetMigrationSeedCount\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/Test/FeatureTestCase.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\Test\\\\FeatureTestCase\\:\\:runSeeds\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/Test/FeatureTestCase.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\Test\\\\FeatureTestCase\\:\\:seeInDatabase\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/Test/FeatureTestCase.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\Test\\\\FeatureTestCase\\:\\:seeNumRecords\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/Test/FeatureTestCase.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\Test\\\\FeatureTestCase\\:\\:seed\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/Test/FeatureTestCase.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\Test\\\\FeatureTestCase\\:\\:setUpDatabase\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/Test/FeatureTestCase.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\Test\\\\FeatureTestCase\\:\\:setUpMigrate\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/Test/FeatureTestCase.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\Test\\\\FeatureTestCase\\:\\:setUpSeed\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/Test/FeatureTestCase.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\Test\\\\FeatureTestCase\\:\\:tearDownDatabase\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/Test/FeatureTestCase.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Only booleans are allowed in a negated boolean, CodeIgniter\\\\Router\\\\RouteCollection\\|null given\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/Test/FeatureTestCase.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Property CodeIgniter\\\\Test\\\\CIUnitTestCase\\:\\:\\$bodyFormat \\(string\\) in isset\\(\\) is not nullable\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/Test/FeatureTestCase.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Property CodeIgniter\\\\Test\\\\CIUnitTestCase\\:\\:\\$clean \\(bool\\) in isset\\(\\) is not nullable\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/Test/FeatureTestCase.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Property CodeIgniter\\\\Test\\\\CIUnitTestCase\\:\\:\\$session \\(array\\) on left side of \\?\\? is not nullable\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/Test/FeatureTestCase.php', -]; $ignoreErrors[] = [ 'message' => '#^Property CodeIgniter\\\\Test\\\\Mock\\\\MockCLIConfig\\:\\:\\$CSRFExcludeURIs has no type specified\\.$#', 'count' => 1,