|
2 | 2 |
|
3 | 3 | use ElaborateCode\JigsawLocalization\Mocks\PageMock; |
4 | 4 |
|
5 | | -test('path es => ar', function () { |
| 5 | +test('URL with base path es => ar', function () { |
6 | 6 | $this->app->config = collect(['baseUrl' => 'https://elaboratecode.com/packages']); |
7 | 7 |
|
8 | 8 | $page = (new PageMock)->setPath('/es/blog'); |
9 | 9 |
|
10 | 10 | expect(translate_url($page, 'ar'))->toBe('https://elaboratecode.com/packages/ar/blog'); |
11 | 11 | }); |
12 | 12 |
|
13 | | -test('path ar <=> fr-CA', function () { |
| 13 | +test('URL with base path ar <=> fr-CA', function () { |
14 | 14 | $this->app->config = collect(['baseUrl' => 'https://elaboratecode.com/packages']); |
15 | 15 |
|
16 | 16 | expect(translate_url((new PageMock)->setPath('/ar/blog'), 'fr-CA'))->toBe('https://elaboratecode.com/packages/fr-CA/blog'); |
17 | 17 | expect(translate_url((new PageMock)->setPath('/fr-CA/blog'), 'fr-CA'))->toBe('https://elaboratecode.com/packages/fr-CA/blog'); |
18 | 18 | }); |
19 | 19 |
|
20 | | -test('path ar <=> haw-US', function () { |
| 20 | +test('URL with base path ar <=> haw-US', function () { |
21 | 21 | $this->app->config = collect(['baseUrl' => 'https://elaboratecode.com/packages']); |
22 | 22 |
|
23 | 23 | expect(translate_url((new PageMock)->setPath('/ar/blog'), 'haw-US'))->toBe('https://elaboratecode.com/packages/haw-US/blog'); |
24 | 24 | expect(translate_url((new PageMock)->setPath('/haw-US/blog'), 'haw-US'))->toBe('https://elaboratecode.com/packages/haw-US/blog'); |
25 | 25 | }); |
26 | 26 |
|
27 | | -test('path haw-US <=> fr-CA', function () { |
| 27 | +test('URL with base path haw-US <=> fr-CA', function () { |
28 | 28 | $this->app->config = collect(['baseUrl' => 'https://elaboratecode.com/packages']); |
29 | 29 |
|
30 | 30 | expect(translate_url((new PageMock)->setPath('/fr-CA/blog'), 'haw-US'))->toBe('https://elaboratecode.com/packages/haw-US/blog'); |
31 | 31 | expect(translate_url((new PageMock)->setPath('/haw-US/blog'), 'fr-CA'))->toBe('https://elaboratecode.com/packages/fr-CA/blog'); |
32 | 32 | }); |
33 | 33 |
|
34 | | -test('path from DEFAULT_LOCALE', function () { |
| 34 | +test('URL with base path from DEFAULT_LOCALE', function () { |
35 | 35 | $this->app->config = collect(['baseUrl' => 'https://elaboratecode.com/packages']); |
36 | 36 |
|
37 | 37 | expect(translate_url((new PageMock)->setPath('/blog'), 'ar'))->toBe('https://elaboratecode.com/packages/ar/blog'); |
|
40 | 40 | expect(translate_url((new PageMock)->setPath('/blog'), packageDefaultLocale()))->toBe('https://elaboratecode.com/packages/blog'); |
41 | 41 | }); |
42 | 42 |
|
43 | | -test('path to DEFAULT_LOCALE', function () { |
| 43 | +test('URL with base path to DEFAULT_LOCALE', function () { |
44 | 44 | $this->app->config = collect(['baseUrl' => 'https://elaboratecode.com/packages']); |
45 | 45 |
|
46 | 46 | expect([ |
|
0 commit comments