Skip to content

Commit

Permalink
ci
Browse files Browse the repository at this point in the history
  • Loading branch information
JirsaR committed Jan 13, 2020
1 parent 7c5fded commit 911f209
Showing 1 changed file with 5 additions and 19 deletions.
24 changes: 5 additions & 19 deletions tests/Unit/Transport/Udp/UdpSenderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
namespace CommonsBundleTests\Unit\Transport\Udp;

use CommonsBundleTests\KernelTestCaseAbstract;
use Exception;
use Hanaboso\CommonsBundle\Transport\Udp\UDPSender;
use Hanaboso\PhpCheckUtils\PhpUnit\Traits\PrivateTrait;
use Hanaboso\Utils\Exception\DateTimeException;
use phpmock\phpunit\PHPMock;
use ReflectionException;

/**
* Class UdpSenderTest
Expand All @@ -22,8 +21,9 @@ final class UdpSenderTest extends KernelTestCaseAbstract

/**
* @covers \Hanaboso\CommonsBundle\Transport\Udp\UDPSender::getSocket
* @covers \Hanaboso\CommonsBundle\Transport\Udp\UDPSender::send
*
* @throws ReflectionException
* @throws Exception
*/
public function testGetSocket(): void
{
Expand All @@ -43,25 +43,11 @@ public function testGetSocket(): void
$this->setProperty($sender, 'socket', '1');

$this->invokeMethod($sender, 'getSocket');

self::assertTrue(TRUE);
}

/**
* @covers \Hanaboso\CommonsBundle\Transport\Udp\UDPSender::send
*
* @throws DateTimeException
*/
public function testSendErr(): void
{
$message = 'abc,name=def,host=ghi key1=val1,key2=val2 1465839830100400200';

$this->getFunctionMock('Hanaboso\CommonsBundle\Transport\Udp', 'socket_sendto')
->expects(self::any())
->willReturn(FALSE);

$sender = new UDPSender();
$result = $sender->send('influxdb:61999', $message);
$sender = new UDPSender();
$result = $sender->send('influxdb:61999', $message);
self::assertFalse($result);
}

Expand Down

0 comments on commit 911f209

Please sign in to comment.