PHPUnit

このページの内容

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

このページでは、PHPUnit タスクを設定する方法について説明します。 

始める前に

  • このタスクを使用するには、PHPUnit をインストールし、PHP コマンド ライン インタープリターのパスを参照する必要があります (Ubuntu での /usr/bin/phpunit など)。


PHPUnit タスクを設定する方法は次のとおりです。

  1. ジョブのタスク設定タブに移動します(新しいプランを作成するとデフォルト ジョブとなります)。
  2. Select the name of an existing task, or select Add task > PHPUnit (or another option, such as PHPUnit 3.3.X) to create a new task.
  3. Update the task settings:
     
    Task description
    Enter a description of the task, for display in Bamboo.

    Disable this task
    Check, or clear, to selectively run this task.

    Add condition to task
    Make task run only when a certain condition is met. 
    You can find conditions on Atlassian Marketplace or implement your own.  


    Executable
    Select the PHPUnit executable that you wish to configure for this task (e.g. "PHPUnit 3.3.x" or "PHPUnit"). The executable that you select will become one of the task's capability requirements (and hence, one of the job's requirements). For details, please see Configuring a job's requirements.

    Arguments
    Type the name of the directory/files that will be analyzed recursively by PHPUnit. The default value is "." (i.e. the working subdirectory, if specified). You must specify at least one argument.

    Environment variables (Optional)
    Additional system environment variables that you want to pass to your build. Note that existing environment variables are automatically available to the executable. You can also include Bamboo global or build-specific variables (see Using global, plan or build-specific variables).
    Multiple variables should be separated with spaces. Parameters with spaces must be quoted (e.g ANT_OPTS="-Xms200m -Xmx700m").

    Working subdirectory (Optional) 
    An alternative subdirectory, relative to the job's root directory, where Bamboo will run the executable. The root directory contains everything checked out from the job's configured source repository. If you leave this field blank, Bamboo will look for build files in the root directory. This option is useful if your task has a build script in a subdirectory and the executable needs to be run from within that subdirectory.

    Log test execution to XML file
    Select if you want PHPUnit to record test results in JUnit format.  (info) This format is also used by TestNG.  
    Test Result File — the relative location, and name, of the file to record PHPUnit test results.

    Generate code coverage report in HTML format
    Select if you want PHPUnit to generate code coverage data in HTML format (e.g. for PHPUnit HTML Code Coverage reports). 
    HTML Code Coverage Directory — the relative location of the directory to store the code coverage report. 


  4. 保存 を選択します。

PHPUnit task type configuration

最終更新日 2021 年 7 月 18 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.