for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace TBolier\RethinkQL\IntegrationTest\Connection;
use Mockery;
use Mockery\MockInterface;
use TBolier\RethinkQL\Connection\ConnectionInterface;
use TBolier\RethinkQL\Connection\OptionsInterface;
use TBolier\RethinkQL\IntegrationTest\BaseTestCase;
use TBolier\RethinkQL\Response\ResponseInterface;
use TBolier\RethinkQL\Types\Query\QueryType;
class ConnectionTest extends BaseTestCase
{
/**
* @var MockInterface
*/
private $optionsMock;
public function setUp()
parent::setUp();
$this->optionsMock = Mockery::mock(OptionsInterface::class);
}
* @throws \Exception
public function testConnect()
/** @var ConnectionInterface $connection */
$connection = $this->createConnection('phpunit_default')->connect();
$result = $connection->expr('foo');
$this->assertInstanceOf(ResponseInterface::class, $result);
$this->assertEquals('foo', $result->getData()[0]);
public function testServer()
$res = $this->createConnection('phpunit_default')->connect()->server();
$this->assertEquals(QueryType::SERVER_INFO, $res->getType());
$this->assertInternalType('string', $res->getData()[0]['name']);