From d7ee56f9b1c71714ca1e1694f374b9f63f11cb23 Mon Sep 17 00:00:00 2001 From: Simon Frings Date: Tue, 30 Mar 2021 11:49:47 +0200 Subject: [PATCH] Set Xdebug's stack limit to 256 for legacy PHP --- tests/FunctionalTest.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/tests/FunctionalTest.php b/tests/FunctionalTest.php index 20c904e..9c38b38 100644 --- a/tests/FunctionalTest.php +++ b/tests/FunctionalTest.php @@ -44,6 +44,9 @@ public function setUpClientServer() /** @group internet */ public function testConnection() { + // max_nesting_level was set to 100 for PHP Versions < 5.4 which resulted in failing test for legacy PHP + ini_set('xdebug.max_nesting_level', 256); + $this->assertResolveStream($this->client->connect('www.google.com:80')); } @@ -92,8 +95,8 @@ public function testConnectionSocks5() /** @group internet */ public function testConnectionSocksOverTls() { - if (!function_exists('stream_socket_enable_crypto')) { - $this->markTestSkipped('Required function does not exist in your environment (HHVM?)'); + if (defined('HHVM_VERSION')) { + $this->markTestSkipped('Not supported on HHVM'); } $socket = new \React\Socket\Server('tls://127.0.0.1:0', $this->loop, array('tls' => array( @@ -117,8 +120,8 @@ public function testConnectionSocksOverTls() */ public function testConnectionSocksOverTlsUsesPeerNameFromSocksUri() { - if (!function_exists('stream_socket_enable_crypto')) { - $this->markTestSkipped('Required function does not exist in your environment (HHVM?)'); + if (defined('HHVM_VERSION')) { + $this->markTestSkipped('Not supported on HHVM'); } $socket = new \React\Socket\Server('tls://127.0.0.1:0', $this->loop, array('tls' => array( @@ -421,8 +424,8 @@ public function testConnectorInvalidUnboundPortTimeout() /** @group internet */ public function testSecureConnectorOkay() { - if (!function_exists('stream_socket_enable_crypto')) { - $this->markTestSkipped('Required function does not exist in your environment (HHVM?)'); + if (defined('HHVM_VERSION')) { + $this->markTestSkipped('Not supported on HHVM'); } $ssl = new SecureConnector($this->client, $this->loop); @@ -445,8 +448,8 @@ public function testSecureConnectorToBadSslWithVerifyFails() /** @group internet */ public function testSecureConnectorToBadSslWithoutVerifyWorks() { - if (!function_exists('stream_socket_enable_crypto')) { - $this->markTestSkipped('Required function does not exist in your environment (HHVM?)'); + if (defined('HHVM_VERSION')) { + $this->markTestSkipped('Not supported on HHVM'); } $ssl = new SecureConnector($this->client, $this->loop, array('verify_peer' => false));