File: AMQPStreamConnectionTest.php

package info (click to toggle)
php-amqplib 3.7.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,044 kB
  • sloc: php: 13,145; makefile: 77; sh: 27
file content (28 lines) | stat: -rw-r--r-- 783 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php

namespace PhpAmqpLib\Tests\Functional\Connection;

use PhpAmqpLib\Tests\Functional\AbstractConnectionTestCase;
use PhpAmqpLib\Tests\Functional\Channel\ChannelWaitTest;
use PHPUnit\Framework\Attributes\Test;

class AMQPStreamConnectionTest extends AbstractConnectionTestCase
{
    /**
     * @group connection
     * @covers \PhpAmqpLib\Wire\IO\StreamIO::select()
     */
    #[Test]
    public function connection_select_blocking_wo_timeout(): void
    {
        $connection = $this->connection_create('stream');

        $start = microtime(true);
        ChannelWaitTest::deferSignal(1);
        $result = $connection->select(null);
        $took = microtime(true) - $start;

        self::assertEquals(0, $result);
        self::assertGreaterThanOrEqual(.9, $took);
    }
}