fix tests

This commit is contained in:
Dennis Eichhorn 2023-10-15 18:58:36 +00:00
parent e997408bb6
commit 4807dcf5c2
5 changed files with 11 additions and 12 deletions

View File

@ -1223,11 +1223,8 @@ final class ReadMapper extends DataMapperAbstract
} }
$objects = $objectMapper->execute(); $objects = $objectMapper->execute();
if (empty($objects) || $objects === false) {
return false;
}
return true; return !empty($objects) && $objects !== false;
} elseif (isset($this->mapper::OWNS_ONE[$member]) } elseif (isset($this->mapper::OWNS_ONE[$member])
|| isset($this->mapper::BELONGS_TO[$member]) || isset($this->mapper::BELONGS_TO[$member])
) { ) {

View File

@ -55,7 +55,9 @@ final class GrahamScan
$points = \array_merge([null], $points); $points = \array_merge([null], $points);
for ($i = 2; $i < $count; ++$i) { for ($i = 2; $i < $count; ++$i) {
if ($points[$i]['y'] < $points[$min]['y'] || ($points[$i]['y'] == $points[$min]['y'] && $points[$i]['x'] < $points[$min]['x'])) { if ($points[$i]['y'] < $points[$min]['y']
|| ($points[$i]['y'] === $points[$min]['y'] && $points[$i]['x'] < $points[$min]['x'])
) {
$min = $i; $min = $i;
} }
} }

View File

@ -85,11 +85,11 @@ class Simplex
$best = -1; $best = -1;
for ($j = 0; $j < $this->n; ++$j) { for ($j = 0; $j < $this->n; ++$j) {
if ($this->c[$j] > 0) { if ($this->c[$j] > 0
if ($best === -1 || $this->Nonbasic[$j] < $ind) { && ($best === -1 || $this->Nonbasic[$j] < $ind)
$ind = $this->Nonbasic[$j]; ) {
$best = $j; $ind = $this->Nonbasic[$j];
} $best = $j;
} }
} }

View File

@ -231,7 +231,7 @@ class BinarySearchTree
) { ) {
$node->parent->left = null; $node->parent->left = null;
} elseif ($node->parent->right !== null } elseif ($node->parent->right !== null
&& $node->parent->right->root->compare($node) === 0 && $node->parent->right->root?->compare($node->data) === 0
) { ) {
$node->parent->right = null; $node->parent->right = null;
} }

View File

@ -763,7 +763,7 @@ final class BuilderTest extends \PHPUnit\Framework\TestCase
$this->expectException(\InvalidArgumentException::class); $this->expectException(\InvalidArgumentException::class);
$query = new Builder($con, true); $query = new Builder($con, true);
$query->select(false); $query->select(new class {});
} }
/** /**