如何显示多个foreach?

我是 phpUnit 的新手,我的项目在 codeigniter 中,我使用的是 netbeans IDE 8.2,我的操作系统是 windows10,我正在尝试测试我的网站,现在我遇到了如何测试我的登录页面的问题?我在下面的代码中尝试过:


class Welcome_test extends TestCase{

    public function addDataProvider(){

        return array(array('email'=>'abc@gmail.com','pass'=>'cdef'));

     }

    /*** @dataProvider addDataProvider*/

    public function test_login(){

        $output = $this->post('Login/submitlogin');

        $this->assertContains('<span class="title">Product List</span>',$output);

    }


}

我期待结果应该通过,但不幸的是我收到了这个错误


Welcome_test::test_login()

PHP 发生致命错误。

PHP 发生致命错误,测试结果可能不完整!

查看完整输出的输出窗口。


慕仙森
浏览 124回答 1
1回答
打开App,查看更多内容
随时随地看视频慕课网APP