From 3e66fb9801de615493aa3b747affbfbe36d89e6a Mon Sep 17 00:00:00 2001 From: Alexander Pekhota Date: Tue, 14 Sep 2021 19:45:25 +0300 Subject: [PATCH] fixed test --- tests/Jaeger/ThriftUdpTransportTest.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/Jaeger/ThriftUdpTransportTest.php b/tests/Jaeger/ThriftUdpTransportTest.php index 374a33b..33a7ad9 100644 --- a/tests/Jaeger/ThriftUdpTransportTest.php +++ b/tests/Jaeger/ThriftUdpTransportTest.php @@ -38,11 +38,18 @@ public function testClose() $this->transport->write('hello'); } - public function testExceptions() { + public function testException() { $this->transport->open(); $this->expectException(TTransportException::class); - $this->expectExceptionMessage("socket_write failed: [code - 40] Message too long"); + + $msgRegEx = "/socket_write failed: \[code - \d+\] Message too long/"; + if (method_exists($this, "expectExceptionMessageRegExp")) { + $this->expectExceptionMessageRegExp($msgRegEx); + } else { + $this->expectExceptionMessageMatches($msgRegEx); + } + $this->transport->write(str_repeat("some string", 10000)); } }