Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F12242643
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/traits/assertHttp.php b/traits/assertHttp.php
index 3b9376b..dec2143 100644
--- a/traits/assertHttp.php
+++ b/traits/assertHttp.php
@@ -1,30 +1,24 @@
<?php
trait assertHttp {
/**
* Asserts the HTTP response code of an URL matches the expected code
- *
- * @param int $expectedCode the expected HTTP response code
- * @param string $url the URL to check
- * @param string $comment the comment to output if the test fails [facultative]
*/
- private function assertHttpResponseCode ($expectedCode, $url, $comment = '') : void {
+ private function assertHttpResponseCode (int $expectedCode, string $url, string $comment = '') : void {
$actualCode = $this->getHttpResponseCode($url);
$this->assertEquals($expectedCode, $actualCode, $comment);
}
/**
* Gets the HTTP response code of the specified URL
- *
- * @param string $url
*/
- private function getHttpResponseCode ($url) : int {
+ private function getHttpResponseCode (string $url) : int {
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_USERAGENT, "Nasqueron-Ops-Tests");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_exec($ch);
$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
return $code;
}
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sun, Oct 12, 09:53 (8 h, 21 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3061731
Default Alt Text
(1 KB)
Attached To
Mode
rTESTSPRODENV Test suite for operations: prod-environment-behaves-correctly
Attached
Detach File
Event Timeline
Log In to Comment