|
@@ -4,7 +4,7 @@ use Workerman\Connection\UdpConnection;
|
|
|
use Symfony\Component\Process\PhpProcess;
|
|
use Symfony\Component\Process\PhpProcess;
|
|
|
use Workerman\Protocols\Text;
|
|
use Workerman\Protocols\Text;
|
|
|
|
|
|
|
|
-$remoteAddress = '[::1]:12345';
|
|
|
|
|
|
|
+$remoteAddress = '127.0.0.1:8082';
|
|
|
$process = null;
|
|
$process = null;
|
|
|
beforeAll(function () use ($remoteAddress, &$process) {
|
|
beforeAll(function () use ($remoteAddress, &$process) {
|
|
|
$process = new PhpProcess(<<<PHP
|
|
$process = new PhpProcess(<<<PHP
|
|
@@ -29,8 +29,8 @@ it('tests ' . UdpConnection::class, function () use ($remoteAddress) {
|
|
|
$udpConnection = new UdpConnection($socketClient, $remoteAddress);
|
|
$udpConnection = new UdpConnection($socketClient, $remoteAddress);
|
|
|
$udpConnection->protocol = Text::class;
|
|
$udpConnection->protocol = Text::class;
|
|
|
expect($udpConnection->send('foo'))->toBeTrue()
|
|
expect($udpConnection->send('foo'))->toBeTrue()
|
|
|
- ->and($udpConnection->getRemoteIp())->toBe('::1')
|
|
|
|
|
- ->and($udpConnection->getRemotePort())->toBe(12345)
|
|
|
|
|
|
|
+ ->and($udpConnection->getRemoteIp())->toBe('127.0.0.1')
|
|
|
|
|
+ ->and($udpConnection->getRemotePort())->toBe(8082)
|
|
|
->and($udpConnection->getRemoteAddress())->toBe($remoteAddress)
|
|
->and($udpConnection->getRemoteAddress())->toBe($remoteAddress)
|
|
|
->and($udpConnection->getLocalIp())->toBeIn(['::1', '[::1]', '127.0.0.1'])
|
|
->and($udpConnection->getLocalIp())->toBeIn(['::1', '[::1]', '127.0.0.1'])
|
|
|
->and($udpConnection->getLocalPort())->toBeInt()
|
|
->and($udpConnection->getLocalPort())->toBeInt()
|