mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-12 01:42:32 +00:00
Fix tests.
This commit is contained in:
@@ -55,4 +55,36 @@ abstract class Node
|
||||
return $this->prohibited;
|
||||
|
||||
}
|
||||
|
||||
public function equals(Node $compare): bool
|
||||
{
|
||||
if ($compare->isProhibited(false) !== $this->isProhibited(false)) {
|
||||
Log::debug('Return false because prohibited status is different');
|
||||
return false;
|
||||
}
|
||||
if ($compare instanceof NodeGroup) {
|
||||
if (count($compare->getNodes()) !== count($this->getNodes())) {
|
||||
Log::debug(sprintf('Return false because node count is different. Original is %d, compare is %d', count($this->getNodes()), count($compare->getNodes())));
|
||||
// var_dump($this);
|
||||
// var_dump($compare);
|
||||
// exit;
|
||||
return false;
|
||||
}
|
||||
/**
|
||||
* @var int $index
|
||||
* @var Node $node
|
||||
*/
|
||||
foreach ($this->getNodes() as $index => $node) {
|
||||
if (false === $node->equals($compare->getNodes()[$index])) {
|
||||
Log::debug('Return false because nodes are different!');
|
||||
var_dump($this);
|
||||
var_dump($compare);
|
||||
exit;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user