diff --git a/tests/Cases/ChannelTest.php b/tests/Cases/ChannelTest.php index 19ee189..8f69a8f 100644 --- a/tests/Cases/ChannelTest.php +++ b/tests/Cases/ChannelTest.php @@ -15,6 +15,7 @@ use Hyperf\Engine\Channel; use Hyperf\Engine\Contract\ChannelInterface; use Hyperf\Engine\Coroutine; +use stdClass; /** * @internal @@ -182,4 +183,16 @@ public function testChannelIsClosing() $this->assertFalse($channel->isAvailable()); }); } + + public function testSplId() + { + $this->runInCoroutine(function () { + $obj = new stdClass(); + $chan = new Channel(1); + $chan->push($obj); + + $this->assertSame(spl_object_id($obj), spl_object_id($assert = $chan->pop())); + $this->assertSame(spl_object_hash($obj), spl_object_hash($assert)); + }); + } }