Behatch / contexts

Behat extension with most custom helper steps
Other
393 stars 203 forks source link

[RestContext] Arrays in request #264

Open Mateuszry opened 6 years ago

Mateuszry commented 6 years ago

After release v3.2.0 with feature: "Allows parameters with dot" #258 arrays in request didn't work as before. Feature:

And I send a "POST" request to "/api/supplier" with parameters:
      | key         | value               |
      | name        | testName            |
      | user[email] | testEmail@email.com |
      | user[lang]  | en                  |

Request dump in Symfony application before release:

array(2) {
  ["name"]=>
  string(8) "testName"
  ["user"]=>
  array(2) {
    ["email"]=>
    string(19) "testEmail@email.com"
    ["lang"]=>
    string(2) "en"
  }
}

Request dump in Symfony application after release:

array(3) {
  ["name"]=>
  string(8) "testName"
  ["user[email]"]=>
  string(19) "testEmail@email.com"
  ["user[lang]"]=>
  string(2) "en"
}

I also tried the syntax with dots: Feature:

    And I send a "POST" request to "/api/supplier" with parameters:
      | key         | value               |
      | name        | testName            |
      | user.email  | testEmail@email.com |
      | user.lang   | en                  |

Request dump in Symfony application:

array(3) {
  ["name"]=>
  string(8) "testName"
  ["user.email"]=>
  string(19) "testEmail@email.com"
  ["user.lang"]=>
  string(2) "en"
}