Skip to content

Commit 4797b2c

Browse files
committed
removed helpers mock file
1 parent 1666509 commit 4797b2c

6 files changed

Lines changed: 9 additions & 47 deletions

File tree

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,9 @@ Wanna see a project that is up and running with this library? checkout this [rep
264264

265265
## TODO
266266

267-
- Check behavior with non A-Z languages.
268-
- Add possibility to customize path structure to deduce current locale (for example set /blog/{locale}/... as a possible pattern).
267+
- Test behavior with non A-Z languages.
268+
- Add a router with named routes
269+
- Allow custom route patterns (for example set /blog/{locale}/)
269270

270271
## Contributing
271272

composer.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@
2929
}
3030
},
3131
"autoload-dev": {
32-
"files": [
33-
"tests/_Mocks/helpers.php"
34-
],
3532
"psr-4": {
3633
"ElaborateCode\\JigsawLocalization\\Mocks\\": "tests/_Mocks"
3734
}

phpstan.neon.dist

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,5 @@ parameters:
55
level: 4
66
paths:
77
- src
8-
scanFiles:
9-
- tests/_Mocks/helpers.php
108
tmpDir: build/phpstan
11-
# checkOctaneCompatibility: true
12-
# checkModelProperties: true
139
checkMissingIterableValueType: false

src/helpers.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
function __($page, string $text, ?string $current_locale = null): string
1717
{
18-
$current_locale ??= $page->current_path_locale();
18+
$current_locale ??= current_path_locale($page);
1919

2020
return $page->localization[$current_locale][$text] ?? $text;
2121
}

tests/Pest.php

Lines changed: 5 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -13,33 +13,10 @@
1313

1414
// uses(Tests\TestCase::class)->in('Feature');
1515

16-
/*
17-
|--------------------------------------------------------------------------
18-
| Expectations
19-
|--------------------------------------------------------------------------
20-
|
21-
| When you're writing tests, you often need to check that values meet certain conditions. The
22-
| "expect()" function gives you access to a set of "expectations" methods that you can use
23-
| to assert different things. Of course, you may extend the Expectation API at any time.
24-
|
25-
*/
26-
27-
expect()->extend('toBeOne', function () {
28-
return $this->toBe(1);
29-
});
30-
31-
/*
32-
|--------------------------------------------------------------------------
33-
| Functions
34-
|--------------------------------------------------------------------------
35-
|
36-
| While Pest is very powerful out-of-the-box, you may have some testing code specific to your
37-
| project that you don't want to repeat in every file. Here you can also expose helpers as
38-
| global functions to help you to reduce the number of lines of code in your test files.
39-
|
40-
*/
41-
42-
function something()
16+
/**
17+
* ! does not take in count the base url
18+
*/
19+
function url(string $path): string
4320
{
44-
// ..
21+
return '/'.trim($path, '/');
4522
}

tests/_Mocks/helpers.php

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)