Finish re-working tests to run on test database
This commit is contained in:
parent
09fc211623
commit
1abca77bdc
50 changed files with 535 additions and 265 deletions
|
@ -59,18 +59,14 @@ class ArticlesController extends Controller
|
|||
* We only have the ID, work out post title, year and month
|
||||
* and redirect to it.
|
||||
*
|
||||
* @param int $idFromUrl
|
||||
* @param string $idFromUrl
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
public function onlyIdInUrl(int $idFromUrl): RedirectResponse
|
||||
public function onlyIdInUrl(string $idFromUrl): RedirectResponse
|
||||
{
|
||||
$realId = resolve(Numbers::class)->b60tonum((string) $idFromUrl);
|
||||
$realId = resolve(Numbers::class)->b60tonum($idFromUrl);
|
||||
|
||||
try {
|
||||
$article = Article::findOrFail($realId);
|
||||
} catch (ModelNotFoundException $exception) {
|
||||
abort(404);
|
||||
}
|
||||
$article = Article::findOrFail($realId);
|
||||
|
||||
return redirect($article->link);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue