mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-09 21:48:41 +00:00
fix tests
This commit is contained in:
parent
e997408bb6
commit
4807dcf5c2
|
|
@ -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])
|
||||||
) {
|
) {
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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 {});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user