Page MenuHomePhabricator

Improve the `PhutilInfrastructureTestCase` unit tests
ClosedPublic

Authored by joshuaspence on Jul 5 2014, 6:54 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Dec 23, 6:40 PM
Unknown Object (File)
Sat, Dec 21, 7:41 PM
Unknown Object (File)
Sat, Dec 21, 7:41 PM
Unknown Object (File)
Sat, Dec 21, 7:41 PM
Unknown Object (File)
Sat, Dec 21, 7:41 PM
Unknown Object (File)
Mon, Dec 16, 2:36 PM
Unknown Object (File)
Fri, Dec 13, 10:38 AM
Unknown Object (File)
Thu, Dec 12, 9:51 PM
Subscribers

Details

Summary

Improve the PhutilInfrastructureTestCase unit tests such that they will fail if any of the following conditions are satisfied:

  • A symbol referenced in the __phutil_library_map__.php file no longer exists.
  • A symbol exists in the library but is not referenced within the __phutil_library_map__.php file.
  • A symbol extends from a different parent symbol than that declared in the __phutil_library_map.php file.
Test Plan

Added a new function. Ran arc unit and observed the test failure.

Diff Detail

Repository
rPHU libphutil
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

joshuaspence retitled this revision from to Improve the `PhutilInfrastructureTestCase::testEverythingImplemented` unit test.
joshuaspence updated this object.
joshuaspence edited the test plan for this revision. (Show Details)
joshuaspence added a reviewer: epriestley.
joshuaspence edited edge metadata.
  • Rename test method
src/moduleutils/PhutilLibraryMapBuilder.php
70–82

I removed this because it simplifies the implementation. Plus, I doubt this is commonly used.

epriestley edited edge metadata.

I think we should retain the phase where the code is loaded. Particularly, it detects things like:

  • syntax error in some file;
  • subclass extending an abstract base class but not implementing all of the required methods.

It seems like we can no longer detect those issues?

This revision now requires changes to proceed.Jul 5 2014, 2:48 PM
joshuaspence edited edge metadata.
  • Rename test method
  • Retain the original test case as well.
  • Improve assertion message
epriestley edited edge metadata.
This revision is now accepted and ready to land.Jul 5 2014, 3:20 PM
joshuaspence retitled this revision from Improve the `PhutilInfrastructureTestCase::testEverythingImplemented` unit test to Improve the `PhutilInfrastructureTestCase` unit tests.Jul 5 2014, 3:20 PM
joshuaspence updated this object.
joshuaspence edited edge metadata.