Skip to content

Commit

Permalink
Merge pull request #4623 from samsonasik/codecoverage-ignore-deprecated
Browse files Browse the repository at this point in the history
[Test] Use @codeCoverageIgnore for deprecated class/method
  • Loading branch information
samsonasik committed Apr 29, 2021
2 parents 06eb51a + 9cbabb0 commit bc576ba
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 2 deletions.
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Expand Up @@ -11,7 +11,7 @@
failOnWarning="true"
verbose="true">

<coverage processUncoveredFiles="true">
<coverage processUncoveredFiles="true" ignoreDeprecatedCodeUnits="true">
<include>
<directory suffix=".php">./system</directory>
</include>
Expand Down
2 changes: 2 additions & 0 deletions system/Controller.php
Expand Up @@ -130,6 +130,8 @@ protected function cachePage(int $time)
* Handles "auto-loading" helper files.
*
* @deprecated Use `helper` function instead of using this method.
*
* @codeCoverageIgnore
*/
protected function loadHelpers()
{
Expand Down
2 changes: 2 additions & 0 deletions system/Database/ModelFactory.php
Expand Up @@ -17,6 +17,8 @@
* Returns new or shared Model instances
*
* @deprecated Use CodeIgniter\Config\Factories::models()
*
* @codeCoverageIgnore
*/
class ModelFactory
{
Expand Down
4 changes: 3 additions & 1 deletion system/Exceptions/CastException.php
Expand Up @@ -14,7 +14,9 @@
/**
* Cast Exceptions.
*
* @deprecated use CodeIgniter\Entity\Exceptions\CastException instead.
* @deprecated use CodeIgniter\Entity\Exceptions\CastException instead.
*
* @codeCoverageIgnore
*/
class CastException extends CriticalError
{
Expand Down
4 changes: 4 additions & 0 deletions system/HTTP/Message.php
Expand Up @@ -61,6 +61,8 @@ public function getBody()
* @return array<string, Header> An array of the request headers
*
* @deprecated Use Message::headers() to make room for PSR-7
*
* @codeCoverageIgnore
*/
public function getHeaders(): array
{
Expand All @@ -76,6 +78,8 @@ public function getHeaders(): array
* @return array|Header|null
*
* @deprecated Use Message::header() to make room for PSR-7
*
* @codeCoverageIgnore
*/
public function getHeader(string $name)
{
Expand Down
6 changes: 6 additions & 0 deletions system/HTTP/Request.php
Expand Up @@ -77,6 +77,8 @@ public function __construct($config = null)
* @return boolean
*
* @deprecated Use Validation instead
*
* @codeCoverageIgnore
*/
public function isValidIP(string $ip = null, string $which = null): bool
{
Expand All @@ -91,6 +93,8 @@ public function isValidIP(string $ip = null, string $which = null): bool
* @return string
*
* @deprecated The $upper functionality will be removed and this will revert to its PSR-7 equivalent
*
* @codeCoverageIgnore
*/
public function getMethod(bool $upper = false): string
{
Expand All @@ -105,6 +109,8 @@ public function getMethod(bool $upper = false): string
* @return Request
*
* @deprecated Use withMethod() instead for immutability
*
* @codeCoverageIgnore
*/
public function setMethod(string $method)
{
Expand Down
2 changes: 2 additions & 0 deletions system/HTTP/Response.php
Expand Up @@ -223,6 +223,8 @@ public function getStatusCode(): int
* @return string
*
* @deprecated Use getReasonPhrase()
*
* @codeCoverageIgnore
*/
public function getReason(): string
{
Expand Down
2 changes: 2 additions & 0 deletions system/Router/Router.php
Expand Up @@ -584,6 +584,8 @@ public function autoRoute(string $uri)
* @return array returns an array of remaining uri segments that don't map onto a directory
*
* @deprecated this function name does not properly describe its behavior so it has been deprecated
*
* @codeCoverageIgnore
*/
protected function validateRequest(array $segments): array
{
Expand Down
2 changes: 2 additions & 0 deletions system/Test/ControllerResponse.php
Expand Up @@ -18,6 +18,8 @@
* Testable response from a controller
*
* @deprecated Use TestResponse directly
*
* @codeCoverageIgnore
*/
class ControllerResponse extends TestResponse
{
Expand Down
2 changes: 2 additions & 0 deletions system/Test/ControllerTester.php
Expand Up @@ -35,6 +35,8 @@
* ->execute('methodName');
*
* @deprecated Use ControllerTestTrait instead
*
* @codeCoverageIgnore
*/
trait ControllerTester
{
Expand Down
2 changes: 2 additions & 0 deletions system/Test/FeatureTestCase.php
Expand Up @@ -30,6 +30,8 @@
* against your application.
*
* @deprecated Use FeatureTestTrait instead
*
* @codeCoverageIgnore
*/
class FeatureTestCase extends CIUnitTestCase
{
Expand Down

0 comments on commit bc576ba

Please sign in to comment.