Skip to content

Commit

Permalink
delete new tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergii Khrystenko committed Feb 15, 2024
1 parent 4dd7a71 commit 4ddb98d
Showing 1 changed file with 1 addition and 76 deletions.
77 changes: 1 addition & 76 deletions tests/Unit/Connection/AMQPStreamConnectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class AMQPStreamConnectionTest extends TestCase
/**
* @test
*/
public function channel_rpc_timeout_should_be_invalid_if_greater_than_read_write_timeout(): void
public function channel_rpc_timeout_should_be_invalid_if_greater_than_read_write_timeout()
{
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('channel RPC timeout must not be greater than I/O read-write timeout');
Expand All @@ -35,79 +35,4 @@ public function channel_rpc_timeout_should_be_invalid_if_greater_than_read_write
5.0
);
}

/**
* @test
* Generate deprecation warning if ssl_protocol is set
*/
public function trigger_deprecation_is_ssl_protocl_set(): void
{
// this is a workaround for deprecated PHPUnit functions
set_error_handler(
static function ($errno, $errstr) {
restore_error_handler();
throw new RuntimeException($errstr, $errno);
},
E_USER_DEPRECATED
);

$this->expectException(RuntimeException::class);
$this->expectExceptionMessage(
'$ssl_protocol parameter is deprecated, use stream_context_set_option($context, \'ssl\', \'crypto_method\', $ssl_protocol) instead (see https://www.php.net/manual/en/function.stream-socket-enable-crypto.php for possible values)'
);

new AMQPStreamConnection(
HOST,
PORT,
USER,
PASS,
VHOST,
false,
'AMQPLAIN',
null,
'en_US',
3.0,
3.0,
null,
false,
0,
3.0,
'test_ssl_protocol'
);
}

/**
* @test
* Generate deprecation warning if ssl_protocol is set with named parameters
*/
public function trigger_deprecation_is_ssl_protocl_set_with_named_params(): void
{
if (PHP_VERSION_ID < 80000) {
$this->markTestSkipped('Named parameters are available in PHP 8.0+');
}

// this is a workaround for deprecated PHPUnit functions
set_error_handler(
static function ($errno, $errstr) {
restore_error_handler();
throw new RuntimeException($errstr, $errno);
},
E_USER_DEPRECATED
);

$this->expectException(RuntimeException::class);
$this->expectExceptionMessage(
'$ssl_protocol parameter is deprecated, use stream_context_set_option($context, \'ssl\', \'crypto_method\', $ssl_protocol) instead (see https://www.php.net/manual/en/function.stream-socket-enable-crypto.php for possible values)'
);

new AMQPStreamConnection(
host: HOST,
port: PORT,
user: USER,
password: PASS,
vhost: VHOST,
channel_rpc_timeout: 3.0,
ssl_protocol: 'test_ssl_protocol'
);
}
}

0 comments on commit 4ddb98d

Please sign in to comment.