File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 2929 }
3030 },
3131 "autoload-dev" : {
32- "files" : [
33- " tests/_Mocks/helpers.php"
34- ],
3532 "psr-4" : {
3633 "ElaborateCode\\ JigsawLocalization\\ Mocks\\ " : " tests/_Mocks"
3734 }
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 1515 */
1616function __ ($ 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}
Original file line number Diff line number Diff line change 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}
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments