mardi 5 juillet 2016

Laravel unit test with input with array name

Input I am trying to fill:

<input type="text" id="order-product-number" name="product_ids[]" class="form-control">

My unit test code:

    public function testSearch()
    {
        $this->actAsUser();
        $this->visit('/orders')
        ->type('12001546', 'order_number[]');
    }

Error I am getting:

1) OrdersTest::testSearch
InvalidArgumentException: Nothing matched the filter [order_number[]] CSS query provided for [http://localhost/orders].

Aucun commentaire:

Enregistrer un commentaire