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