簡體   English   中英

如何使用此文件PHPunit測試“擴展PHPUnit_Framework_TestCase”

[英]How to use this File PHPunit test “extend PHPUnit_Framework_TestCase”

這是文件測試,它需要PHPunit並且我安裝了PHPunit,但不知道使用它:

 <?php 
    # -*- compile-command: (concat "phpunit " buffer-file-name) -*-
    require_once 'PHPUnit/Framework.php';
    require_once 'common.php';

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

它指導:

安裝后(PHPunit),只需在目錄頂部運行phpunit命令,它將啟動測試。

但是我不明白怎么做> <

您在這里有很多未解決的問題。 但是 ,立即發現身份驗證類的名稱存在問題。

PHPUnit要求根據特定的命名約定對所有運行的測試用例進行命名。

我想不起來了,但我認為是testAuthentication

我將研究一些代碼,然后再回頭給您。

EDIT1:嘗試命名AuthenticationTest類,並在其中放入一個名為testAuthentication的函數

應該符合PHPUnit運行測試的要求

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM