コード例 #1
0
 /**
  * @Then the output should be a Json containing :productCount product's info with :totalPrice as the total price
  */
 public function theOutputShouldBeAJsonContainingProductSInfoWithAsTheTotalPrice($productCount, $totalPrice)
 {
     $result = $this->commandTester->getDisplay();
     assertJson($result);
     $resultToArray = json_decode($result, true);
     assertCount((int) $productCount, $resultToArray['result']);
     assertEquals((double) $totalPrice, $resultToArray['total']);
 }
コード例 #2
0
 /**
  * @Then response body should be a valid json
  */
 public function responseBodyShouldBeAValidJson()
 {
     assertJson($this->client->getResponse()->getContent());
 }
コード例 #3
0
 /**
  * @Then Assert the json :arg1 is valid
  * @param $string
  */
 public function assertJson($string)
 {
     assertJson((string) $string, sprintf("Assert the json [%s] is valid", $string));
 }