/** * @dataProvider getCommentsDataProvider */ public function testGetComments($caseSubject, $order, $expectedCommentsMessage) { $case = $this->getContainer()->get('doctrine.orm.entity_manager')->getRepository('OroCRMCaseBundle:CaseEntity')->findOneBySubject($caseSubject); $this->assertNotEmpty($case); $comments = $this->manager->getCaseComments($case, $order); $this->assertCount(count($expectedCommentsMessage), $comments); $this->assertSame($expectedCommentsMessage, array_map(function (CaseComment $comment) { return $comment->getMessage(); }, $comments)); }
/** * {@inheritdoc} */ public function createEntity() { return $this->caseManager->createCase(); }
/** * @param CaseEntity $case * @param string $order * @return CaseComment[] */ public function getCaseComments(CaseEntity $case, $order = 'DESC') { return $this->caseManager->getCaseComments($case, $order); }