2016-06-28 1 views
0

Phabricator用のカスタムユニットテストを作成したいと思います。そのために Phabricator:ランユニットテスト

、私は私が得る、私はそれを実行しようとすると、以下の内容

class PhabricatorTrivialTestCase extends PhabricatorTestCase { 

    private $two; 

    public function willRunOneTest($test_name) { 
    // You can execute setup steps which will run before each test in this 
    // method. 
    $this->two = 2; 
    } 

    public function testAllIsRightWithTheWorld() { 
    $this->assertEqual(4, $this->two + $this->two, '2 + 2 = 4'); 
    } 

} 

で(些細なphabricatorのテストケースを使用するため)Writing Unit Tests in Phabricatorのドキュメントをチェックアウトし、./phabricator/src/infrastructure/testing/testcase/PhabricatorTrivialTestCase.phpでファイルを作成しました次のメッセージ。

$ cd ./phabricator 
$ arc unit src/infrastructure/testing/testcase/ 
No tests to run. 

文書化されているようにテストを実行できないのはなぜですか?いくつかのステップが欠落していますか?

答えて

0

最後に解決策を見つけました。

いくつかのことを行う必要がありました。

  • は(名前PhabricatorTrivialTestCaseとテストがすでに存在するため)PhabricatorTrivialTestCaseSomePhabricatorTrivialTestCaseから
  • 名前を変更したクラス
  • 実行arc liberate(のためのSomeTrivialPhabricatorTestCaseを利用できるようにする(フォルダは__tests__なければならない)ディレクトリ./src/extensions/__tests__にテストファイルを移動しましたテスト)
  • コミットの変更
  • 実行arc unit --everythingarc unitは「実行するテストはありません」を返しますが、arc unit --everything作品
関連する問題