Skip to content

Commit e91af1c

Browse files
committed
test: add test for url_to() with locale
1 parent ce89424 commit e91af1c

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

tests/system/Helpers/URLHelper/MiscUrlTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -884,4 +884,20 @@ public function urlToMissingRoutesProvider()
884884
],
885885
];
886886
}
887+
888+
public function testUrlToWithSupportedLocaleInRoute()
889+
{
890+
Services::createRequest(new App());
891+
$routes = service('routes');
892+
$routes->add(
893+
'{locale}/path/(:segment)/to/(:num)',
894+
'myController::goto/$1/$2',
895+
['as' => 'path-to']
896+
);
897+
898+
$this->assertSame(
899+
'http://example.com/index.php/en/path/string/to/13',
900+
url_to('path-to', 'string', 13, 'en')
901+
);
902+
}
887903
}

0 commit comments

Comments
 (0)