We're not using the library formatter, so we can't rely on the library test coverage.

This is the test coverage we want to transfer into the Drupal test:
https://github.com/commerceguys/addressing/blob/master/tests/Formatter/D...

The test should live in src/Tests/Formatter and extend KernelTestBase, just like the core formatter tests.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dbolinovski’s picture

bojanz’s picture

Status: Active » Needs work
FileSize
4.82 KB

Here's a patch that passes. It only has the El Salvador asserts. Now the other asserts from the library test (linked in the OP) need to be ported over as well.

Remember to expand the $countryCodes array for each new country.

testUnitedStatesIncompleteAddress will be easy to port, testTaiwanAddress will require importing the "zh-hant" translation for the TW address format in setUp().

googletorp’s picture

Assigned: Unassigned » googletorp
googletorp’s picture

I'm having some issues to figure out how to use the imported translation for the address format.

Uploaded the improve patch, also got it in my github fork.

bojanz’s picture

Status: Needs work » Fixed

Committed.

  • bojanz committed 653c9e1 on 8.x-1.x authored by dbolinovski
    Issue #2525766 by bojanz, dbolinovski: Add initial tests for the default...
  • bojanz committed 8225c2d on 8.x-1.x authored by googletorp
    Issue #2525766 by bojanz, googletorp: Complete the tests for the default...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.