DefaultPathTest.php 923 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Framework\App\Test\Unit\DefaultPath;
  7. class DefaultPathTest extends \PHPUnit\Framework\TestCase
  8. {
  9. /**
  10. * @param array $parts
  11. * @param string $code
  12. * @param string $result
  13. * @dataProvider dataProviderGetPart
  14. */
  15. public function testGetPart($parts, $code, $result)
  16. {
  17. $model = new \Magento\Framework\App\DefaultPath\DefaultPath($parts);
  18. $this->assertEquals($result, $model->getPart($code));
  19. }
  20. /**
  21. * @return array
  22. */
  23. public function dataProviderGetPart()
  24. {
  25. return [
  26. [
  27. ['code' => 'value'],
  28. 'code',
  29. 'value',
  30. ],
  31. [
  32. ['code' => 'value'],
  33. 'other_code',
  34. null,
  35. ],
  36. ];
  37. }
  38. }