X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fphp%2Ftests%2Funit_tests%2FChannelTest.php;h=b7df853bb2d61e48e5729fec866fc59a8df4056b;hb=71f640b484f7b64c4f023c2601b378b958144f9e;hp=a9341060d0e4c5657d3af7b2bd3a4f82d9f0c143;hpb=b7597e751030150c16207b51b38267ba4a4a6bfb;p=platform%2Fupstream%2Fgrpc.git diff --git a/src/php/tests/unit_tests/ChannelTest.php b/src/php/tests/unit_tests/ChannelTest.php index a934106..b7df853 100644 --- a/src/php/tests/unit_tests/ChannelTest.php +++ b/src/php/tests/unit_tests/ChannelTest.php @@ -52,7 +52,7 @@ class ChannelTest extends \PHPUnit\Framework\TestCase $this->assertNotNull($xdsCreds); } - public function testCreateXdsWithInsecure() { + public function disabled_testCreateXdsWithInsecure() { $xdsCreds = \Grpc\ChannelCredentials::createXds( \Grpc\ChannelCredentials::createInsecure() ); @@ -64,9 +64,21 @@ class ChannelTest extends \PHPUnit\Framework\TestCase $xdsCreds = \Grpc\ChannelCredentials::createXds(null); } - public function testCreateXdsWithInvalidType() { - $this->expectException(\TypeError::class); - $xdsCreds = \Grpc\ChannelCredentials::createXds("invalid-type"); + public function testCreateXdsWithInvalidType() + { + $expected = $this->logicalOr( + // PHP8 + new \PHPUnit\Framework\Constraint\Exception(\InvalidArgumentException::class), + // PHP7 + new \PHPUnit\Framework\Constraint\Exception(\TypeError::class) + ); + try { + $xdsCreds = \Grpc\ChannelCredentials::createXds("invalid-type"); + } catch (\Throwable $exception) { + $this->assertThat($exception, $expected); + return; + } + $this->assertThat(null, $expected); } public function testGetConnectivityState() @@ -353,6 +365,7 @@ class ChannelTest extends \PHPUnit\Framework\TestCase ), 50306, ], + /* [ \Grpc\ChannelCredentials::createXds( \Grpc\ChannelCredentials::createInSecure() @@ -362,6 +375,7 @@ class ChannelTest extends \PHPUnit\Framework\TestCase ), 50307, ], + */ ]; } @@ -424,6 +438,7 @@ class ChannelTest extends \PHPUnit\Framework\TestCase ), 50353, ], + /* [ \Grpc\ChannelCredentials::createXds( \Grpc\ChannelCredentials::createSsl() @@ -440,6 +455,7 @@ class ChannelTest extends \PHPUnit\Framework\TestCase ), 50355, ], + */ [ \Grpc\ChannelCredentials::createSsl(), \Grpc\ChannelCredentials::createXds(