Skip to content

Commit e9822e0

Browse files
committed
fix test to not hit php.net
1 parent e70c9f0 commit e9822e0

File tree

2 files changed

+36
-2
lines changed

2 files changed

+36
-2
lines changed

ext/standard/tests/network/http-stream.phpt

+8-2
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,22 @@ http-stream test
33
--SKIPIF--
44
<?php
55
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
6-
if (getenv("SKIP_ONLINE_TESTS")) die("skip online test");
76
if (!extension_loaded("dom")) die("skip dom extension is not present");
7+
require __DIR__.'/../http/server.inc';
8+
http_server_skipif('tcp://127.0.0.1:12342');
89
?>
910
--INI--
1011
allow_url_fopen=1
1112
--FILE--
1213
<?php
14+
require __DIR__.'/../http/server.inc';
15+
16+
$pid = http_server("tcp://127.0.0.1:12342", [__DIR__."/news.rss"]);
17+
1318
$d = new DomDocument;
14-
$e = $d->load("http://php.net/news.rss");
19+
$e = $d->load("http://127.0.0.1:12342/news.rss");
1520
echo "ALIVE\n";
21+
http_server_kill($pid);
1622
?>
1723
--EXPECTF--
1824
ALIVE

ext/standard/tests/network/news.rss

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
HTTP/1.1 200 OK
2+
Content-Type: text/xml
3+
4+
<?xml version="1.0" encoding="utf-8"?>
5+
<rdf:RDF
6+
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
7+
xmlns="http://purl.org/rss/1.0/"
8+
xmlns:dc="http://purl.org/dc/elements/1.1/"
9+
>
10+
<channel rdf:about="http://php.net/">
11+
<title>PHP: Hypertext Preprocessor</title>
12+
<link>http://php.net/</link>
13+
<description>The PHP scripting language web site</description>
14+
<items>
15+
<rdf:Seq>
16+
<rdf:li rdf:resource="http://php.net/index.php#id2015-01-22-3" />
17+
</rdf:Seq>
18+
</items>
19+
</channel>
20+
21+
<item rdf:about="http://php.net/index.php#id2015-01-22-3">
22+
<title>PHP 5.4.37 Released</title>
23+
<link>http://php.net/index.php#id2015-01-22-3</link>
24+
<description>The PHP development team announces the immediate availability of PHP 5.4.37. Six security-related bugs were fixed in this release, including CVE-2015-0231, CVE-2014-9427 and CVE-2015-0232. All PHP 5.4 users are encouraged to upgrade to this version. For source downloads of PHP 5.4.37 please visit our downloads page, Windows binaries can be found on windows.php.net/download/. The list of changes is recorded in the ChangeLog.</description>
25+
<dc:date>2015-01-22</dc:date>
26+
</item>
27+
28+
</rdf:RDF>

0 commit comments

Comments
 (0)