Ensure that all base classes extend from Phobject. See D13275 for some explanation.
Details
- Reviewers
epriestley - Group Reviewers
Blessed Reviewers - Commits
- rPHU3ff84448a916: Extend from Phobject
arc unit
Diff Detail
- Repository
- rPHU libphutil
- Branch
- master
- Lint
Lint Passed - Unit
Tests Skipped - Build Status
Buildable 6742 Build 6764: [Placeholder Plan] Wait for 30 Seconds
Event Timeline
There were two issues with the unit tests. Firstly, I was unable to run the test suite due to the change to PhutilTestClassA:
Exception Attempting to run unit tests on a libphutil library which has not been loaded, at: /home/joshua/workspace/github.com/phacility/libphutil/support/phutiltestlib This probably means one of two things: - You may need to add this library to .arcconfig.. - You may be running tests on a copy of libphutil or arcanist using a different copy of libphutil or arcanist. This operation is not supported. (Run with `--trace` for a full exception trace.)
Secondly, I'm not sure why this test was failing:
FAIL PhutilRemarkupEngineTestCase::testEngine EXCEPTION (DomainException): Attempt to write to undeclared property PhutilRemarkupEngine::storage. #0 /home/joshua/workspace/github.com/phacility/libphutil/src/markup/engine/PhutilRemarkupEngine.php(285): Phobject->__set('storage', Object(PhutilRemarkupBlockStorage)) #1 /home/joshua/workspace/github.com/phacility/libphutil/src/markup/engine/PhutilRemarkupEngine.php(94): PhutilRemarkupEngine->postprocessText(Array) #2 /home/joshua/workspace/github.com/phacility/libphutil/src/markup/engine/__tests__/PhutilRemarkupEngineTestCase.php(43): PhutilRemarkupEngine->markupText('**duck\nquack**') #3 /home/joshua/workspace/github.com/phacility/libphutil/src/markup/engine/__tests__/PhutilRemarkupEngineTestCase.php(11): PhutilRemarkupEngineTestCase->markupText('/home/joshua/wo...') #4 [internal function]: PhutilRemarkupEngineTestCase->testEngine() #5 /home/joshua/workspace/github.com/phacility/arcanist/src/unit/engine/phutil/PhutilTestCase.php(492): call_user_func_array(Array, Array) #6 /home/joshua/workspace/github.com/phacility/arcanist/src/unit/engine/PhutilUnitTestEngine.php(65): PhutilTestCase->run() #7 /home/joshua/workspace/github.com/phacility/arcanist/src/workflow/ArcanistUnitWorkflow.php(186): PhutilUnitTestEngine->run() #8 /home/joshua/workspace/github.com/phacility/arcanist/scripts/arcanist.php(382): ArcanistUnitWorkflow->run() #9 {main}
Firstly, I was unable to run the test suite due to the change
Maybe we just leave the warning for now (don't extend Phobject) and eventually fix it with T1549?
Secondly, I'm not sure why this test was failing:
This looks like a real issue which this change has detected: PhutilRemarkupEngine reads and writes to a property called $storage, but does not declare such a property. The fix is probably adding private $storage; to the class.
Oh!
This:
unset($this->storage);
Probably needs to be:
$this->storage = null;
Because PHP LOL.
To clarify, the issue is that the .arcconfig file doesn't load support/phutiltestlib. This maybe seems like a general issue in that you can't properly diff libraries which aren't explicitly loaded.