Skip to content

Commit 5abafd5

Browse files
supertassuKrinkle
authored andcommitted
test: support https protocol
Updates the test script to require passing a protocol instead of assuming everything is done over plain http.
1 parent 7334413 commit 5abafd5

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

test/CodeoriginTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44
*
55
* $ php test/CodeoriginTest.php
66
*
7-
* $ php test/CodeoriginTest.php "localhost:4000"
7+
* $ php test/CodeoriginTest.php "http://localhost:4000"
88
*
9-
* $ php test/CodeoriginTest.php "code.jquery.com"
9+
* $ php test/CodeoriginTest.php "http://code.jquery.com"
10+
* $ php test/CodeoriginTest.php "https://code.jquery.com"
1011
*/
1112

1213
require_once __DIR__ . '/Unit.php';
13-
$server = @$argv[1] ?: 'localhost:4000';
14+
$server = @$argv[1] ?: 'http://localhost:4000';
1415

1516
Unit::start();
1617

test/Unit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public static function test( $name, $actual, $expected ) {
7676

7777
public static function testHttp( $server, $path, array $reqHeaders, array $expectHeaders, $expectBody = null ) {
7878
try {
79-
$resp = jq_req( "http://{$server}{$path}", $reqHeaders );
79+
$resp = jq_req( "{$server}{$path}", $reqHeaders );
8080
foreach ( $expectHeaders as $key => $val ) {
8181
// Tolerate E-Tag weakning (which Highwinds CDN does)
8282
if ( $key == 'etag' ) {

0 commit comments

Comments
 (0)