File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,7 @@ public function theApiResponseJsonPathFieldIsEqual(string $jsonPath, string $val
93
93
);
94
94
}
95
95
96
+
96
97
/**
97
98
* @Given the api response json path :jsonPath does not equal :value
98
99
*/
@@ -101,6 +102,7 @@ public function theApiResponseXpathNotEquals(string $jsonPath, string $value)
101
102
$ this ->dontSeeResponseJsonMatchesJsonPath ($ jsonPath , $ value );
102
103
}
103
104
105
+
104
106
/**
105
107
* @Given the api response should contain headers
106
108
*/
@@ -110,4 +112,34 @@ public function theApiResponseShouldContainHeaders(TableNode $table)
110
112
$ this ->seeHttpHeader ($ row [0 ], $ row [1 ]);
111
113
}
112
114
}
115
+
116
+
117
+ /**
118
+ * @Given the api response equals :value
119
+ */
120
+ public function theApiResponseEquals (string $ value )
121
+ {
122
+ $ actual = $ this ->grabResponse ();
123
+ Assert::assertEquals (
124
+ $ value ,
125
+ $ actual ,
126
+ sprintf ('Value of content is not equal expected %s actual %s ' , $ value , $ actual )
127
+ );
128
+ }
129
+
130
+ /**
131
+ * @Given the api response should return a JSON string with json path
132
+ */
133
+ public function theApiResponseShouldReturnStringWithJsonPath (TableNode $ table )
134
+ {
135
+ foreach ($ table ->getRows () as $ index => $ row ) {
136
+ $ data = $ this ->grabDataFromResponseByJsonPath ($ row [0 ]);
137
+
138
+ Assert::assertEquals (
139
+ $ row [1 ],
140
+ $ data [0 ],
141
+ sprintf ('Value of json path %s is not equal expected %s actual %s ' , $ row [0 ], $ row [1 ], $ data [0 ])
142
+ );
143
+ }
144
+ }
113
145
}
You can’t perform that action at this time.
0 commit comments