开发者

How to use this File PHPunit test "extend PHPUnit_Framework_TestCase"

开发者 https://www.devze.com 2023-01-26 13:14 出处:网络
This is FIle Test it require PHPunit and i installed PHPunit , but dont knowuse it: <?php # -*- compile-c开发者_开发技巧ommand: (concat \"phpunit \" buffer-file-name) -*-

This is FIle Test it require PHPunit and i installed PHPunit , but dont know use it:

 <?php 
    # -*- compile-c开发者_开发技巧ommand: (concat "phpunit " buffer-file-name) -*-
    require_once 'PHPUnit/Framework.php';
    require_once 'common.php';

    class Authentication extends PHPUnit_Framework_TestCase{
    ........
    }
    ?>

it guide :

When installed ( PHPunit) just run the command phpunit on the top of the directory and it will launch the tests.

But i dont understand how do ><


There are a lot of questions you've left unanswered here. BUT right off the bat, I see that you've got a problem with the name of the Authentication class.

PHPUnit requires that any testcases that are run be named according to a specific naming convention.

I can't recall off the top of my head, but I think it's testAuthentication

I'll look into some of my code and get back to you.

EDIT1: try naming the class AuthenticationTest and put a function inside it called testAuthentication

that should meet with PHPUnit's requirements to run your tests

0

精彩评论

暂无评论...
验证码 换一张
取 消