mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-09 13:38:41 +00:00
fix tests
This commit is contained in:
parent
999ec823b3
commit
ec49bf2dc1
|
|
@ -247,7 +247,7 @@ class BinarySearchTree
|
||||||
}
|
}
|
||||||
|
|
||||||
$temp = null;
|
$temp = null;
|
||||||
if ($node->right !== null) {
|
if ($node->left === null) {
|
||||||
$temp = $node->right->root;
|
$temp = $node->right->root;
|
||||||
if ($temp === null) {
|
if ($temp === null) {
|
||||||
return;
|
return;
|
||||||
|
|
@ -272,7 +272,7 @@ class BinarySearchTree
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($node->left !== null) {
|
if ($node->right === null) {
|
||||||
$temp = $node->left->root;
|
$temp = $node->left->root;
|
||||||
if ($temp === null) {
|
if ($temp === null) {
|
||||||
return;
|
return;
|
||||||
|
|
@ -306,11 +306,11 @@ class BinarySearchTree
|
||||||
/**
|
/**
|
||||||
* To array
|
* To array
|
||||||
*
|
*
|
||||||
* @return array
|
* @return null|array
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public function toArray() : array
|
public function toArray() : ?array
|
||||||
{
|
{
|
||||||
return $this->root?->toArray() ?? null;
|
return $this->root?->toArray() ?? null;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -124,20 +124,20 @@ final class BinarySearchTreeTest extends \PHPUnit\Framework\TestCase
|
||||||
'key' => 'O',
|
'key' => 'O',
|
||||||
0 => null,
|
0 => null,
|
||||||
1 => [
|
1 => [
|
||||||
'key' => 'R',
|
'key' => 'U',
|
||||||
0 => null,
|
0 => [
|
||||||
1 => [
|
'key' => 'R',
|
||||||
'key' => 'U',
|
0 => null,
|
||||||
0 => [
|
1 => [
|
||||||
'key' => 'T',
|
'key' => 'T',
|
||||||
0 => null,
|
0 => null,
|
||||||
1 => null
|
1 => null
|
||||||
],
|
]
|
||||||
1 => [
|
],
|
||||||
'key' => 'Z',
|
1 => [
|
||||||
0 => null,
|
'key' => 'Z',
|
||||||
1 => null
|
0 => null,
|
||||||
],
|
1 => null
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user