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 name phabricatortrivialtestcase exists)
  • run arc liberate (to make sometrivialphabricatortestcase available testing)
  • commit changes
  • run arc unit --everything (because arc unit returns "no tests run", arc unit --everything works

Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -