What kind of filed is tags?
Jun 28, 2016
6
Level 1
Test a select2 field with PHPUnit
I'm trying to test a form with a select2 field with this code :
$this->actingAs($this->loggedUser)
->visit('admin/conference/create')
->submitForm('Add', [
'name' => 'Forum PHP 2016',
'location' => 'Paris',
'start_at' => '2016-10-27 09:00:00',
'end_at' => '2016-10-28 18:00:00',
'cfp_link' => 'http://event.afup.org/forum-php-2016/appel-a-conferenciers/',
'cfp_ends_at' => '2016-07-31 23:59:59',
'tags' => ['PHP'],
])
->see('Forum PHP 2016');
But the output error is :
1) ConferencesTest::logged_user_can_post_a_new_conference
InvalidArgumentException: Input "tags" cannot take "PHP" as a value (possible values: ).
Level 1
Well, I solved my problem.
I had not any tag records in my test database, so, thanks to captain obvious!
For future readers here : don't forget to seed your test database ;)
1 like
Please or to participate in this conversation.