Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ignore coverage on !CI_DEBUG #2814

Merged
merged 1 commit into from
Apr 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
ignore coverage on !CI_DEBUG
  • Loading branch information
samsonasik committed Apr 9, 2020
commit b836ce735d416b61056c026039e11d22d3b57a31
2 changes: 2 additions & 0 deletions system/CodeIgniter.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,9 @@ public function initialize()

if (! CI_DEBUG)
{
// @codeCoverageIgnoreStart
\Kint::$enabled_mode = false;
// @codeCoverageIgnoreEnd
}
}

Expand Down
30 changes: 22 additions & 8 deletions system/Database/BaseBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -999,8 +999,9 @@ protected function _whereIn(string $key = null, $values = null, bool $not = fals
{
throw new InvalidArgumentException(sprintf('%s() expects $key to be a non-empty string', debug_backtrace(0, 2)[1]['function']));
}

// @codeCoverageIgnoreStart
return $this;
// @codeCoverageIgnoreEnd
}

if ($values === null || (! is_array($values) && ! ($values instanceof Closure)))
Expand All @@ -1009,8 +1010,9 @@ protected function _whereIn(string $key = null, $values = null, bool $not = fals
{
throw new InvalidArgumentException(sprintf('%s() expects $values to be of type array or closure', debug_backtrace(0, 2)[1]['function']));
}

// @codeCoverageIgnoreStart
return $this;
// @codeCoverageIgnoreEnd
}

is_bool($escape) || $escape = $this->db->protectIdentifiers;
Expand Down Expand Up @@ -2036,8 +2038,9 @@ public function insertBatch(array $set = null, bool $escape = null, int $batchSi
{
throw new DatabaseException('You must use the "set" method to update an entry.');
}

// @codeCoverageIgnoreStart
return false;
// @codeCoverageIgnoreEnd
}
}
else
Expand All @@ -2048,8 +2051,9 @@ public function insertBatch(array $set = null, bool $escape = null, int $batchSi
{
throw new DatabaseException('insertBatch() called with no data');
}

// @codeCoverageIgnoreStart
return false;
// @codeCoverageIgnoreEnd
}

$this->setInsertBatch($set, '', $escape);
Expand Down Expand Up @@ -2258,8 +2262,9 @@ protected function validateInsert(): bool
{
throw new DatabaseException('You must use the "set" method to update an entry.');
}

// @codeCoverageIgnoreStart
return false;
// @codeCoverageIgnoreEnd
}

return true;
Expand Down Expand Up @@ -2308,7 +2313,9 @@ public function replace(array $set = null)
{
throw new DatabaseException('You must use the "set" method to update an entry.');
}
// @codeCoverageIgnoreStart
return false;
// @codeCoverageIgnoreEnd
}

$table = $this->QBFrom[0];
Expand Down Expand Up @@ -2492,8 +2499,9 @@ protected function validateUpdate(): bool
{
throw new DatabaseException('You must use the "set" method to update an entry.');
}

// @codeCoverageIgnoreStart
return false;
// @codeCoverageIgnoreEnd
}

return true;
Expand Down Expand Up @@ -2521,8 +2529,9 @@ public function updateBatch(array $set = null, string $index = null, int $batchS
{
throw new DatabaseException('You must specify an index to match on for batch updates.');
}

// @codeCoverageIgnoreStart
return false;
// @codeCoverageIgnoreEnd
}

if ($set === null)
Expand All @@ -2533,7 +2542,9 @@ public function updateBatch(array $set = null, string $index = null, int $batchS
{
throw new DatabaseException('You must use the "set" method to update an entry.');
}
// @codeCoverageIgnoreStart
return false;
// @codeCoverageIgnoreEnd
}
}
else
Expand All @@ -2544,7 +2555,9 @@ public function updateBatch(array $set = null, string $index = null, int $batchS
{
throw new DatabaseException('updateBatch() called with no data');
}
// @codeCoverageIgnoreStart
return false;
// @codeCoverageIgnoreEnd
}

$this->setUpdateBatch($set, $index);
Expand Down Expand Up @@ -2793,8 +2806,9 @@ public function delete($where = '', int $limit = null, bool $reset_data = true)
{
throw new DatabaseException('Deletes are not allowed unless they contain a "where" or "like" clause.');
}

// @codeCoverageIgnoreStart
return false;
// @codeCoverageIgnoreEnd
}

$sql = $this->_delete($table);
Expand Down
2 changes: 2 additions & 0 deletions system/Database/Postgre/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,9 @@ public function replace(array $set = null)
{
throw new DatabaseException('You must use the "set" method to update an entry.');
}
// @codeCoverageIgnoreStart
return false;
// @codeCoverageIgnoreEnd
}

$table = $this->QBFrom[0];
Expand Down
2 changes: 2 additions & 0 deletions system/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,9 @@ public function delete($id = null, bool $purge = false)
{
throw new DatabaseException('Deletes are not allowed unless they contain a "where" or "like" clause.');
}
// @codeCoverageIgnoreStart
return false;
// @codeCoverageIgnoreEnd
}
$set[$this->deletedField] = $this->setDate();

Expand Down