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
phabricatortrivialtestcase
somephabricatortrivialtestcase
(because test namephabricatortrivialtestcase
exists) - run
arc liberate
(to makesometrivialphabricatortestcase
available testing) - commit changes
- run
arc unit --everything
(becausearc unit
returns "no tests run",arc unit --everything
works
Comments
Post a Comment