public function theQuantityOfElementInEntityIs($className, $expresion) {
        $doctrine = $this->getDoctrine();
        $em = $doctrine->getManager();
        $query = $em->createQuery('SELECT COUNT(u.id) FROM ' . $className . ' u');
        $count = $query->getSingleScalarResult();
        $expAmount = explode(" ", $expresion);
        $amount2 = \Pandco\Bundle\AppBundle\Service\Util\CurrencyUtil::fotmatToNumber($expAmount[1]);
        if (version_compare($count, $amount2, $expAmount[0]) === false) {
            throw new Exception(sprintf("Expected '%s' but there quantity is '%s'.", $expresion, $count));
        }
    }
public function theQuantityOfElementInEntityIs($className, $expresion) {
        $doctrine = $this->getDoctrine();
        $em = $doctrine->getManager();
        $query = $em->createQuery('SELECT COUNT(u.id) FROM ' . $className . ' u');
        $count = $query->getSingleScalarResult();
        $expAmount = explode(" ", $expresion);
        $amount2 = \Pandco\Bundle\AppBundle\Service\Util\CurrencyUtil::fotmatToNumber($expAmount[1]);
        if (version_compare($count, $amount2, $expAmount[0]) === false) {
            throw new Exception(sprintf("Expected '%s' but there quantity is '%s'.", $expresion, $count));
        }
    }
public function theQuantityOfElementInEntityIs ( $ className , $ expresion ) { $ doctrine = $ this -> getDoctrine ( ) ; $ em = $ doctrine -> getManager ( ) ; $ query = $ em -> createQuery ( 'SELECT COUNT(u.id) FROM ' . $ className . ' u' ) ; $ count = $ query -> getSingleScalarResult ( ) ; $ expAmount = explode ( " " , $ expresion ) ; $ amount2 = \ Pandco \ Bundle \ AppBundle \ Service \ Util \ CurrencyUtil :: fotmatToNumber ( $ expAmount [ 1 ] ) ; if ( version_compare ( $ count , $ amount2 , $ expAmount [ 0 ] ) === false ) { throw new Exception ( sprintf ( "Expected '%s' but there quantity is '%s'." , $ expresion , $ count ) ) ; } }
Cuenta la cantidad de elementos de una tabla
@example And the quantity of element in entity "Pandco\Bundle\AppBundle\Entity\Core\Email\EmailQueue" is "= 2"
@example And the quantity of element in entity "Pandco\Bundle\AppBundle\Entity\Core\Email\EmailQueue" is "> 0"
@Given the quantity of element in entity :className is :expresion
Cuenta la cantidad de elementos de una tabla