Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Mbezdek's avatar

InvalidArgumentException: Input "language_id" cannot take "1" as a value (possible values: ).

Hi, I have a problem with Unit Testing in Laravel 5.1.

In database I have 2 tables: orders and languages. The orders collumn language_id has a relationship whit languages.

When I submit the form in browser, everything works fine, but when I submit the form In UnitTest, I get error message InvalidArgumentException: Input "language_id" cannot take "1" as a value (possible values: ).

In languages table I have row with ID 1 :)

Does anybody know, what to do?

Thx for any response :) Martin

0 likes
4 replies
Thijmen's avatar

Perhaps you are using another database for testing?

Please or to participate in this conversation.