Page MenuHomePhabricator

Extend from Phobject
ClosedPublic

Authored by joshuaspence on Jun 14 2015, 12:48 PM.
Tags
None
Referenced Files
F14014809: D13280.diff
Sun, Nov 3, 8:41 AM
F14002858: D13280.id32101.diff
Fri, Oct 25, 11:14 PM
F14002231: D13280.id.diff
Fri, Oct 25, 4:33 PM
F13979179: D13280.id32143.diff
Sat, Oct 19, 3:05 AM
F13963110: D13280.diff
Tue, Oct 15, 2:02 PM
F13962673: D13280.id32120.diff
Tue, Oct 15, 11:34 AM
F13962617: D13280.diff
Tue, Oct 15, 11:11 AM
F13962482: D13280.id.diff
Tue, Oct 15, 10:22 AM
Subscribers

Details

Summary

Ensure that all base classes extend from Phobject. See D13275 for some explanation.

Test Plan

arc unit

Diff Detail

Repository
rPHU libphutil
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

joshuaspence retitled this revision from to Extend from Phoject.
joshuaspence updated this object.
joshuaspence edited the test plan for this revision. (Show Details)
joshuaspence added a reviewer: epriestley.

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.

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.

Right, but I did add that to the class.

Oh!

This:

unset($this->storage);

Probably needs to be:

$this->storage = null;

Because PHP LOL.

I learn something new every day...

chad retitled this revision from Extend from Phoject to Extend from Phobject.Jun 14 2015, 8:49 PM
chad edited edge metadata.

Maybe we just leave the warning for now (don't extend Phobject) and eventually fix it with T1549?

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.

  • Fix PhutilRemarkupEngine
  • Remove change to PhutilTestClassA for now
epriestley edited edge metadata.
This revision is now accepted and ready to land.Jun 14 2015, 9:49 PM
This revision was automatically updated to reflect the committed changes.