entityManager = $kernel->getContainer() ->get('doctrine') ->getManager(); $this->repo = $this->entityManager->getRepository(User::class); } public function testGetGenericNodeTree(): void { $tree = $this->repo->getGenericNodeTree(); $this->assertIsArray($tree); $this->assertContainsOnlyInstancesOf(TreeViewNode::class, $tree); $this->assertCount(4, $tree); $this->assertSame('admin', $tree[0]->getText()); $this->assertEmpty($tree[0]->getNodes()); } }