Skip to content

Commit 7fec514

Browse files
committed
more testing
1 parent 13cb96d commit 7fec514

5 files changed

Lines changed: 22 additions & 7 deletions

File tree

tests/Pest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@
1111
|
1212
*/
1313

14-
uses(Tests\TestCase::class)->in('unit/LocaleUrlHelperTest.php');
14+
uses(Tests\TestCase::class)->in('unit/LocaleUrlTest.php');
Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,13 @@
33
use ElaborateCode\JigsawLocalization\Mocks\PageMock;
44

55
it('sets path on DEFAULT_LOCALE for partial path', function () {
6-
$this->app->config = collect(['baseUrl' => '']);
7-
86
$page = new PageMock;
97

10-
expect(locale_url($page, 'blog'))->toBe('/blog');
8+
expect(locale_path($page, 'blog'))->toBe('/blog');
119
});
1210

1311
it('sets path on locale for partial path', function () {
14-
$this->app->config = collect(['baseUrl' => '']);
15-
1612
$page = new PageMock;
1713

18-
expect(locale_url($page, 'blog', 'ar'))->toBe('/ar/blog');
14+
expect(locale_path($page, 'blog', 'ar'))->toBe('/ar/blog');
1915
});

tests/unit/LocaleUrlTest.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
use ElaborateCode\JigsawLocalization\Mocks\PageMock;
4+
5+
it('sets path on DEFAULT_LOCALE for partial path', function () {
6+
$this->app->config = collect(['baseUrl' => 'https://elaboratecode.com/packages']);
7+
8+
$page = new PageMock;
9+
10+
expect(locale_url($page, 'blog'))->toBe('https://elaboratecode.com/packages/blog');
11+
});
12+
13+
it('sets path on locale for partial path', function () {
14+
$this->app->config = collect(['baseUrl' => 'https://elaboratecode.com/packages']);
15+
16+
$page = new PageMock;
17+
18+
expect(locale_url($page, 'blog', 'ar'))->toBe('https://elaboratecode.com/packages/ar/blog');
19+
});

0 commit comments

Comments
 (0)