Finish re-working tests to run on test database

This commit is contained in:
Jonny Barnes 2021-08-31 12:28:00 +01:00
parent 09fc211623
commit 1abca77bdc
50 changed files with 535 additions and 265 deletions

View file

@ -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);
}