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)
Wed, Apr 24, 10:48 PM
Unknown Object (File)
Sat, Apr 20, 7:13 PM
Unknown Object (File)
Sat, Apr 20, 12:54 AM
Unknown Object (File)
Thu, Apr 11, 10:35 AM
Unknown Object (File)
Apr 2 2024, 9:08 PM
Unknown Object (File)
Mar 26 2024, 8:24 PM
Unknown Object (File)
Mar 24 2024, 1:53 AM
Unknown Object (File)
Mar 13 2024, 3:27 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.