php - Phabricator: run unit test -
i want write custom unit test phabricator.
for purpose, checked out documentation writing unit tests in phabricator , created file @ ./phabricator/src/infrastructure/testing/testcase/phabricatortrivialtestcase.php (for using trivial phabricator test case) following content
class phabricatortrivialtestcase extends phabricatortestcase { private $two; public function willrunonetest($test_name) { // can execute setup steps run before each test in // method. $this->two = 2; } public function testallisrightwiththeworld() { $this->assertequal(4, $this->two + $this->two, '2 + 2 = 4'); } } when try run it, following message.
$ cd ./phabricator $ arc unit src/infrastructure/testing/testcase/ no tests run. why can't run test documented? there step missing?
finally figured out solution.
a few things had done.
- moved test file directory
./src/extensions/__tests__(the folder has__tests__) - renamed class
phabricatortrivialtestcasesomephabricatortrivialtestcase(because test namephabricatortrivialtestcaseexists) - run
arc liberate(to makesometrivialphabricatortestcaseavailable testing) - commit changes
- run
arc unit --everything(becausearc unitreturns "no tests run",arc unit --everythingworks
Comments
Post a Comment