@@ -82,7 +82,7 @@ class CreateUserCest
82
82
{
83
83
$I-> amHttpAuthenticated('service_user', '123456');
84
84
$I->haveHttpHeader('Content-Type', 'application/x-www-form-urlencoded');
85
- $I->sendPOST ('/users', [
85
+ $I->sendPost ('/users', [
86
86
'name' => 'davert',
87
87
'email' => 'davert@codeception.com'
88
88
]);
@@ -131,26 +131,26 @@ $I->haveHttpHeader('content-type', 'application/json');
131
131
132
132
{% endhighlight %}
133
133
134
- When headers are set, you can send a request. To obtain data use `sendGET `:
134
+ When headers are set, you can send a request. To obtain data use `sendGet `:
135
135
136
136
{% highlight php %}
137
137
138
138
<? php
139
139
// pass in query params in second argument
140
- $I-> sendGET ('/posts', [ 'status' => 'pending' ]);
140
+ $I-> sendGet ('/posts', [ 'status' => 'pending' ]);
141
141
$I->seeResponseCodeIs(200);
142
142
$I->seeResponseIsJson();
143
143
144
144
{% endhighlight %}
145
145
146
- > `sendGET ` won't return any value. However, you can access data from a response and perform assertions using other available methods of REST module.
146
+ > `sendGet ` won't return any value. However, you can access data from a response and perform assertions using other available methods of REST module.
147
147
148
148
To create or update data you can use other common methods:
149
149
150
- * `sendPOST `
151
- * `sendPUT `
152
- * `sendDELETE `
153
- * `sendPATCH `
150
+ * `sendPost `
151
+ * `sendPut `
152
+ * `sendDelete `
153
+ * `sendPatch `
154
154
155
155
### JSON Structure Validation
156
156
@@ -159,7 +159,7 @@ If we expect a JSON response to be received we can check its structure with [JSO
159
159
{% highlight php %}
160
160
161
161
<? php
162
- $I-> sendGET ('/users');
162
+ $I-> sendGet ('/users');
163
163
$I->seeResponseCodeIs(HttpCode::OK); // 200
164
164
$I->seeResponseIsJson();
165
165
$I->seeResponseJsonMatchesJsonPath('$[0].user.login');
@@ -173,7 +173,7 @@ You can do that by using with a [seeResponseMatchesJsonType](http://codeception.
173
173
{% highlight php %}
174
174
175
175
<? php
176
- $I-> sendGET ('/users/1');
176
+ $I-> sendGet ('/users/1');
177
177
$I->seeResponseCodeIs(HttpCode::OK); // 200
178
178
$I->seeResponseIsJson();
179
179
$I->seeResponseMatchesJsonType([
@@ -198,7 +198,7 @@ When you need to obtain a value from a response and use it in next requests you
198
198
199
199
<? php
200
200
list($id) = $I-> grabDataFromResponseByJsonPath('$.id');
201
- $I->sendGET ('/pet/' . $id);
201
+ $I->sendGet ('/pet/' . $id);
202
202
203
203
{% endhighlight %}
204
204
@@ -252,7 +252,7 @@ There is `seeXmlResponseIncludes` method to match inclusion of XML parts in resp
252
252
{% highlight php %}
253
253
254
254
<? php
255
- $I-> sendGET ('/users.xml');
255
+ $I-> sendGet ('/users.xml');
256
256
$I->seeResponseCodeIs(\Codeception\Util\HttpCode::OK); // 200
257
257
$I->seeResponseIsXml();
258
258
$I->seeXmlResponseMatchesXpath('//user/login');
@@ -390,4 +390,4 @@ Codeception has two modules that will help you to test various web services. The
390
390
391
391
392
392
* **Next Chapter: [Codecoverage >](/docs/11-Codecoverage)**
393
- * **Previous Chapter: [< Data](/docs/09-Data)**
393
+ * **Previous Chapter: [< Data](/docs/09-Data)**
0 commit comments