icingaweb2/test/php/library/Icinga/Protocol/Livestatus/ConnectionTest.php

34 lines
774 B
PHP
Executable File

<?php
namespace Tests\Icinga\Protocol\Livestatus;
use Icinga\Protocol\Livestatus\Connection;
use Icinga\Protocol\Livestatus\Query;
use PHPUnit_Framework_TestCase as TestCase;
require_once('../../library/Icinga/Protocol/AbstractQuery.php');
require_once('../../library/Icinga/Protocol/Livestatus/Connection.php');
require_once('../../library/Icinga/Protocol/Livestatus/Query.php');
/**
*
* Test class for Connection
*
**/
class ConnectionTest extends TestCase
{
/**
* Test for Connection::Select()
*
**/
public function testSelect()
{
$socket = tempnam(sys_get_temp_dir(), 'IcingaTest');
$connection = new Connection($socket);
$this->assertTrue($connection->select() instanceof Query);
unlink($socket);
}
}