Some checks are pending
CI / release_executable (push) Waiting to run
CI / release (push) Waiting to run
CI / debug (push) Waiting to run
CI / debug_executable (push) Waiting to run
CI / check-phpunit (push) Waiting to run
CI / check-phpdoc (push) Waiting to run
CI / generate-phpdoc (push) Blocked by required conditions
CI / test (push) Blocked by required conditions
CI / release-documentation (push) Blocked by required conditions
CI / release-artifacts (push) Blocked by required conditions
37 lines
1.1 KiB
PHP
37 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace Socialbox;
|
|
|
|
use Exception;
|
|
use Helper;
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
class SocialClientTest extends TestCase
|
|
{
|
|
|
|
public function testCoffeePing(): void
|
|
{
|
|
try
|
|
{
|
|
$rpcClient = new SocialClient(Helper::generateRandomPeer(COFFEE_DOMAIN, prefix: 'pingTest'));
|
|
$this->assertTrue($rpcClient->ping(), sprintf('Failed to ping %s', COFFEE_DOMAIN));
|
|
}
|
|
catch (Exception $e)
|
|
{
|
|
$this->fail('Failed to create RPC client: ' . $e->getMessage());
|
|
}
|
|
}
|
|
|
|
public function testTeapotPing(): void
|
|
{
|
|
try
|
|
{
|
|
$rpcClient = new SocialClient(Helper::generateRandomPeer(TEAPOT_DOMAIN, prefix: 'pingTest'));
|
|
$this->assertTrue($rpcClient->ping(), sprintf('Failed to ping %s', TEAPOT_DOMAIN));
|
|
}
|
|
catch (Exception $e)
|
|
{
|
|
$this->fail('Failed to create RPC client: ' . $e->getMessage());
|
|
}
|
|
}
|
|
}
|