Привет, ребят.
Почему Тест возвращает пустой
$article->id?
-------------------------------
Array ([$article->id] => )
-------------------------------
class ArticlesController extends Controller
{
public function update(ArticleRequest $request, Article $article)
{
throw new Exception(print_r([
'$article->id' => $article->id
]));
}
}
class ArticleTest extends TestCase
{
public function test_article_update_success(): void
{
$this->withoutMiddleware();
$article = factory(Article::class)->create();
$putArr = [
'name' => $this->faker->name,
'body' => $this->faker->sentence,
];
$response = $this->put(route('admin.articles.update', $article), $putArr);
throw $response->exception;
}
}