@diosmosis opened this Pull Request on July 26th 2014 Member

Refactoring of IntegrationTestCase for code clarity and cleanliness. Reduces the size of IntegrationTestCase.php and removes a lot of testing hacks.

Includes the following changes:

  • moved all API URL generation logic & API response handling logic to separate classes
  • created ApiTestConfig class to hold API test options (and documentation for properties)
  • remove unnecessary IntegrationTestCase properties and methods (including apiNotToCall/apiToCall)
  • remove as many unnecessary API test options as possible (including abandonedCarts, hackDeleteRangeArchivesBefore)
  • rename checkRequestResponse to assertApiResponseHasNoError
  • cleaned up API/Request::__construct handling of arrays (allows arrays to be used as test requests instead of actual URLs)


I verified that all tests are being executed (master & this branch execute the same test cases and same API test URLs). There is a difference in the number of assertions reported by phpunit, however:

Integration 998 (master) => 997 (tests refactor)
Plugin 2489 (master) => 2481 (tests refactor)
Core 1257 (master) => 1259 (tests refactor)

I can't locate the cause of the discrepancy, but I don't think it matters considering the same amount of API urls and test cases are tested.

@diosmosis commented on July 26th 2014 Member

Closed by accident

@mattab commented on August 1st 2014 Owner

looks good!

This Pull Request was closed on August 1st 2014
Powered by GitHub Issue Mirror