ZipCodeFixerTest.php 892 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /**
  3. * @copyright Vertex. All rights reserved. https://www.vertexinc.com/
  4. * @author Mediotype https://www.mediotype.com/
  5. */
  6. namespace Vertex\Tax\Test\Unit\Model;
  7. use Vertex\Tax\Model\ZipCodeFixer;
  8. use Vertex\Tax\Test\Unit\TestCase;
  9. class ZipCodeFixerTest extends TestCase
  10. {
  11. public function dataProvider()
  12. {
  13. return [
  14. ['245', '00245'],
  15. ['2801-1234', '02801-1234'],
  16. ['44131', '44131'],
  17. ['44131-1234', '44131-1234'],
  18. ['02801-1234', '02801-1234'],
  19. [null, null],
  20. ];
  21. }
  22. /**
  23. * @param string $codeToFix
  24. * @param string $codeToExpect
  25. * @dataProvider dataProvider
  26. */
  27. public function testFix($codeToFix, $codeToExpect)
  28. {
  29. $fixer = new ZipCodeFixer();
  30. $this->assertEquals($codeToExpect, $fixer->fix($codeToFix));
  31. }
  32. }