getManager(); $repo = self::getContainer()->get(BranchSyncRepository::class); $item = (new BranchSync()) ->setBranchName('Branch') ->setAdminName('Julio') ; $this->assertHasNoEntityViolations($item); $em->persist($item); $em->flush(); // By default there's a root branch. $this->assertSame(2, $repo->count([])); } }