Skip to content

Commit

Permalink
Enhancement: Assert that getNeighborsAndSelf() returns array with nod…
Browse files Browse the repository at this point in the history
…e when node is root
  • Loading branch information
localheinz committed Jan 28, 2023
1 parent 805b824 commit 62ed455
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/Unit/Node/NodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,17 @@ public function testGetNeighbors(): void
self::assertSame([$b, $c], $a->getNeighbors());
}

public function testGetNeighborsAndSelfReturnsArrayWithNodeWhenNodeDoesNotHaveParent(): void
{
$node = new Node(self::faker()->sentence());

$expected = [
$node,
];

self::assertSame($expected, $node->getNeighborsAndSelf());
}

public function testGetNeighborsAndSelf(): void
{
$root = new Node('r');
Expand Down

0 comments on commit 62ed455

Please sign in to comment.