33 lines
793 B
PHP
33 lines
793 B
PHP
<?php
|
|
|
|
namespace Tests\Unit;
|
|
|
|
use LDC\LDCCRM\CrmApiV2;
|
|
use LDC\LDCCRM\Enums\ApiStatus;
|
|
use LDC\LDCCRM\Enums\HttpMethods;
|
|
use LDC\LDCCRM\Transport\ApiInterface;
|
|
use LDC\LDCCRM\Transport\Request;
|
|
|
|
class CrmClientV2ClientTest extends CrmClientTester
|
|
{
|
|
public function testApiInterface()
|
|
{
|
|
$routes = $this->getClientRoutes();
|
|
$interface = new ApiInterface();
|
|
|
|
$request = new Request(
|
|
HttpMethods::make(\strtolower($routes['apiV2.ping']['methods'][0])),
|
|
$routes['apiV2.ping']['uri']
|
|
);
|
|
|
|
$response = $interface->call($request);
|
|
|
|
$this->assertEquals(ApiStatus::OK(), $response->status);
|
|
}
|
|
|
|
public function testClientPing()
|
|
{
|
|
$api = new CrmApiV2();
|
|
$this->assertTrue($api->ping());
|
|
}
|
|
}
|