简体   繁体   中英

How to use this File PHPunit test “extend PHPUnit_Framework_TestCase”

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

 <?php 
    # -*- compile-command: (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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM