Skip to content

Commit 7308b68

Browse files
author
konradt
committed
Changed names of the method to camelCase
1 parent 4f7052e commit 7308b68

7 files changed

Lines changed: 44 additions & 34 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ CHANGELOG
88
- Fixed serious bug in **Curl.php**. Was not setting curl option `CURLOPT_POST` back to `false` in `get_request()`.
99

1010
### v0.1.1 - *3/8/2014*
11-
- Added a special flag `IS_EMPTY` which can be passed into `assert_body()` to assert an empty response body.
11+
- Added a special flag `IS_EMPTY` which can be passed into `assertBody()` to assert an empty response body.

src/Dogpatch.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public function assertHeaders(array $assertedHeaders = array()) {
142142
}
143143
}
144144
////
145-
// Standard indexed array, call assert_headers_exist() instead
145+
// Standard indexed array, call assertHeadersExist() instead
146146
////
147147
else {
148148
$this->assertHeadersExist($assertedHeaders);

src/examples/auth.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,23 @@
1717

1818
require_once(dirname(__DIR__) . "/Dogpatch.php");
1919

20+
use Dogpatch\Dogpatch;
21+
2022
$dogpatch = new Dogpatch(array(
2123
"username" => "foo",
2224
"password" => 'bar',
2325
"timeout" => 10
2426
));
2527

2628
$dogpatch->get("https://api.stripe.com")
27-
->assert_status_code(401)
28-
->assert_headers_exist(array(
29+
->assertStatusCode(401)
30+
->assertHeadersExist(array(
2931
"www-Authenticate"
3032
))
31-
->assert_headers(array(
33+
->assertHeaders(array(
3234
"Server" => "nginx",
3335
"Cache-Control" => "no-cache, no-store"
3436
))
35-
->assert_body(IS_VALID_JSON)
37+
->assertBody(IS_VALID_JSON)
3638
->close();
37-
?>
39+
?>

src/examples/get.php

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,35 +17,37 @@
1717

1818
require_once(dirname(__DIR__) . "/Dogpatch.php");
1919

20+
use Dogpatch\Dogpatch;
21+
2022
$dogpatch = new Dogpatch();
2123

2224
$dogpatch->get("https://freegeoip.net/csv/8.8.8.8")
23-
->assert_status_code(200)
24-
->assert_headers(array(
25+
->assertStatusCode(200)
26+
->assertHeaders(array(
2527
"Access-Control-Allow-Origin" => "*"
2628
))
27-
->assert_body('"8.8.8.8","US","United States","","","","","38.0000","-97.0000","",""');
29+
->assertBody('"8.8.8.8","US","United States","","","","","38.0000","-97.0000","",""');
2830

2931
$dogpatch->get("https://www.google.com")
30-
->assert_status_code(200)
31-
->assert_headers_exist(array(
32+
->assertStatusCode(200)
33+
->assertHeadersExist(array(
3234
"X-Frame-Options"
3335
))
34-
->assert_headers(array(
36+
->assertHeaders(array(
3537
"Server" => "gws",
3638
"Transfer-Encoding" => "chunked"
3739
))
38-
->assert_body("/<!doctype html>.*/", USE_REGEX);
40+
->assertBody("/<!doctype html>.*/", USE_REGEX);
3941

4042
$dogpatch->get("https://api.github.com")
41-
->assert_status_code(200)
42-
->assert_headers_exist(array(
43+
->assertStatusCode(200)
44+
->assertHeadersExist(array(
4345
"X-GitHub-Request-Id",
4446
"ETag"
4547
))
46-
->assert_headers(array(
48+
->assertHeaders(array(
4749
"Server" => "GitHub.com"
4850
))
49-
->assert_body(IS_VALID_JSON)
51+
->assertBody(IS_VALID_JSON)
5052
->close();
51-
?>
53+
?>

src/examples/json_file.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,18 @@
1717

1818
require_once(dirname(__dir__) . "/Dogpatch.php");
1919

20+
use Dogpatch\Dogpatch;
21+
2022
$dogpatch = new Dogpatch();
2123

2224
$dogpatch->get("https://freegeoip.net/json/8.8.8.8")
23-
->assert_status_code(200)
24-
->assert_headers_exist(array(
25+
->assertStatusCode(200)
26+
->assertHeadersExist(array(
2527
"Content-Length"
2628
))
27-
->assert_headers(array(
29+
->assertHeaders(array(
2830
"Access-Control-Allow-Origin" => "*"
2931
))
30-
->assert_body_json_file(dirname(__DIR__) . "/examples/json/freegeoip.net.json", ECHO_JSON)
32+
->assertBodyJsonFile(dirname(__DIR__) . "/examples/json/freegeoip.net.json", ECHO_JSON)
3133
->close();
32-
?>
34+
?>

src/examples/php.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
require_once(dirname(__dir__) . "/Dogpatch.php");
1919

20+
use Dogpatch\Dogpatch;
21+
2022
$expected = new stdClass();
2123
$expected->ip = "8.8.8.8";
2224
$expected->country_code = "US";
@@ -33,13 +35,13 @@
3335
$dogpatch = new Dogpatch();
3436

3537
$dogpatch->get("https://freegeoip.net/json/8.8.8.8")
36-
->assert_status_code(200)
37-
->assert_headers_exist(array(
38+
->assertStatusCode(200)
39+
->assertHeadersExist(array(
3840
"Date"
3941
))
40-
->assert_headers(array(
42+
->assertHeaders(array(
4143
"Access-Control-Allow-Origin" => "*"
4244
))
43-
->assert_body_php($expected, VAR_EXPORT)
45+
->assertBodyPhp($expected, VAR_EXPORT)
4446
->close();
45-
?>
47+
?>

src/examples/post.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,21 @@
1717

1818
require_once(dirname(__dir__) . "/Dogpatch.php");
1919

20+
use Dogpatch\Dogpatch;
21+
2022
$dogpatch = new Dogpatch(array(
2123
"timeout" => 30
2224
));
2325

2426
$dogpatch->post("https://api.balancedpayments.com/api_keys")
25-
->assert_status_code(201)
26-
->assert_headers_exist(array(
27+
->assertStatusCode(201)
28+
->assertHeadersExist(array(
2729
"X-Balanced-Host",
2830
"X-Balanced-Guru"
2931
))
30-
->assert_headers(array(
32+
->assertHeaders(array(
3133
"Content-Type" => "application/json"
3234
))
33-
->assert_body(IS_VALID_JSON)
35+
->assertBody(IS_VALID_JSON)
3436
->close();
35-
?>
37+
?>

0 commit comments

Comments
 (0)