lundi 13 juillet 2015

Laravel 5.1 - Testing a multiple selectbox

I'm experiencing trouble when I write my tests for a multiple select box with the Laravel 5.1 testing helpers.

I've tried both storeInput and select which is kinda much an alias for storeInput. When I'm working with a multiple select and I want the input to be formatted as an array I've created a <select name="roles[]"> but this is not testable, I can't write something like this $this->storeInput( 'roles[]', [ 1, 2 ] ). The errors I get then is: Symfony\Component\CssSelector\Exception\SyntaxErrorException: Expected identifier or "*", but <delimiter "]" at 8> found.

How is this possible to go around? I've also tested with an ID but then I get the error Unreachable field "THE_ID".

Aucun commentaire:

Enregistrer un commentaire