add unit tests

This commit is contained in:
Dennis Eichhorn 2021-11-02 21:57:10 +01:00
parent 05066c520e
commit bbab09b0ea
3 changed files with 3 additions and 4 deletions

View File

@ -2932,7 +2932,7 @@ class DataMapperAbstract implements DataMapperInterface
*/
public static function getNewest(int $limit = 1, Builder $query = null, int $relations = RelationType::ALL, int $depth = 3) : array
{
$query ??= self::getQuery(null, [], $relations, $depth);
$query = self::getQuery($query, [], $relations, $depth);
$query->limit($limit);
if (!empty(static::$createdAt)) {

View File

@ -62,12 +62,11 @@ final class HttpHeader extends HeaderAbstract
return false;
}
$key = \strtolower($key);
if (self::isSecurityHeader($key) && isset($this->header[$key])) {
return false;
}
$key = \strtolower($key);
if (!$overwrite && isset($this->header[$key])) {
return false;
}

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="Bootstrap.php" colors="true" stopOnError="true" stopOnFailure="false" stopOnIncomplete="false" stopOnSkipped="false" beStrictAboutTestsThatDoNotTestAnything="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="Bootstrap.php" colors="true" columns="120" stopOnError="true" stopOnFailure="false" stopOnIncomplete="false" stopOnSkipped="false" beStrictAboutTestsThatDoNotTestAnything="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage includeUncoveredFiles="true" processUncoveredFiles="false">
<include>
<directory suffix=".php">.*</directory>