Add a zendframework-php Tutorial

Source: Internet
Author: User
Please add a zendframework question. I'm using phpunit to test the model in the zend project. & nbsp; this model is like this: Register {TODOimpreveinsertshere (moreportablebetweenanothe please add a zend framework question
I'm using phpunit to test the model in the zend project,
This model is like this:
PHP code
  class Application_Model_AdminGroupMapper {    // TODO impreve inserts here (more portable between another db engines)    static function assignMembersToGroup(        Application_Model_AdminGroup &$group, array &$member_ids)    {        $inserts = array();        foreach($member_ids as $id) {            $inserts[] = '('.$group->id.','.mysql_real_escape_string($id).')';        }        $db = Zend_Registry::get('db');        $res = $db->query(            'INSERT IGNORE INTO admin_group_has_member(admin_group_id, member_id) VALUES '.            implode(',', $inserts));        return $res->rowCount();    }


The phpunit I wrote is like this:
PHP code
  class Application_Model_AdminGroupMapper {    // TODO impreve inserts here (more portable between another db engines)    static function assignMembersToGroup(        Application_Model_AdminGroup &$group, array &$member_ids)    {        $inserts = array();        foreach($member_ids as $id) {            $inserts[] = '('.$group->id.','.mysql_real_escape_string($id).')';        }        $db = Zend_Registry::get('db');        $res = $db->query(            'INSERT IGNORE INTO admin_group_has_member(admin_group_id, member_id) VALUES '.            implode(',', $inserts));        return $res->rowCount();    }


But when I run it, I run it in Netbeans and always prompts that I didn't perform any tests. why?

------ Solution --------------------
Isn't the two pieces of code you posted the same?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.