Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
matyhtf committed Jul 3, 2024
1 parent d468afe commit 483f2b2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions tests/include/api/curl_multi.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function swoole_test_curl_multi_ex($mh, $options = []) {
curl_setopt($ch1, CURLOPT_HEADER, 0);
curl_setopt($ch1, CURLOPT_RETURNTRANSFER, 1);

curl_setopt($ch2, CURLOPT_URL, "https://www.zhihu.com/");
curl_setopt($ch2, CURLOPT_URL, "https://www.taobao.com/");
curl_setopt($ch2, CURLOPT_HEADER, 0);
curl_setopt($ch2, CURLOPT_RETURNTRANSFER, 1);

Expand Down Expand Up @@ -61,7 +61,7 @@ function swoole_test_curl_multi_ex($mh, $options = []) {
Assert::eq($info3, false);

Assert::contains(curl_multi_getcontent($ch1), 'baidu.com');
Assert::contains(curl_multi_getcontent($ch2), 'zhihu');
Assert::contains(curl_multi_getcontent($ch2), 'taobao.com');

curl_multi_remove_handle($mh, $ch1);
curl_multi_remove_handle($mh, $ch2);
Expand Down
4 changes: 2 additions & 2 deletions tests/swoole_curl/ssl/version.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ $cm->run(function ($host) {
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, "https://www.qq.com/");
curl_setopt($ch, CURLOPT_URL, "https://www.baidu.com/");
$result = curl_exec($ch);
Assert::assert($result);
Assert::contains($result, 'tencent');
Assert::contains($result, '百度');
curl_close($ch);

}, false);
Expand Down
4 changes: 2 additions & 2 deletions tests/swoole_http_client_coro/http_proxy.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ skip_if_offline();
<?php
require __DIR__ . '/../include/bootstrap.php';
go(function () {
$domain = 'www.qq.com';
$domain = 'www.baidu.com';
$cli = new Swoole\Coroutine\Http\Client($domain, 443, true);
// $cli->setHeaders(['Host' => $domain]); // without host header it can also work well
$cli->set([
Expand All @@ -20,7 +20,7 @@ go(function () {
]);
$result = $cli->get('/');
Assert::assert($result);
Assert::assert(stripos($cli->body, 'tencent') !== false);
Assert::assert(stripos($cli->body, '百度') !== false);
echo "DONE\n";
});
?>
Expand Down

0 comments on commit 483f2b2

Please sign in to comment.