lundi 13 juillet 2015

Test Cases for Functions in Symfony

I am new in testing.I want test my function.Here is my code

$em = $this->getDoctrine()->getEntityManager();
            $id = $_REQUEST['id'];
            $documents = $em->createQueryBuilder()
            ->select('documents')
            ->from('DRPAdminBundle:Document',  'documents')
            ->where('documents.book_id=:id')
            ->setParameter('id', $id)
            ->getQuery()
            ->getArrayResult();

How can I test this function using PhpUnit.

Please Help.

Aucun commentaire:

Enregistrer un commentaire