laravel-websockets/tests/ClientProviders/ClientTest.php

42 lines
985 B
PHP
Raw Normal View History

2018-11-28 22:59:58 +00:00
<?php
namespace BeyondCode\LaravelWebSockets\Tests\ClientProviders;
2018-12-01 12:57:02 +00:00
use BeyondCode\LaravelWebSockets\Apps\App;
2018-11-28 22:59:58 +00:00
use BeyondCode\LaravelWebSockets\Exceptions\InvalidClient;
use BeyondCode\LaravelWebSockets\Tests\TestCase;
class ClientTest extends TestCase
{
/** @test */
public function it_can_create_a_client()
{
2018-12-01 12:57:02 +00:00
new App(1, 'appKey', 'appSecret', 'new');
2018-11-28 22:59:58 +00:00
$this->markTestAsPassed();
}
/** @test */
public function it_will_not_accept_an_empty_appKey()
{
$this->expectException(InvalidClient::class);
2018-12-01 12:57:02 +00:00
new App(1, '', 'appSecret', 'new');
2018-11-28 22:59:58 +00:00
}
/** @test */
public function it_will_not_accept_an_empty_appSecret()
{
$this->expectException(InvalidClient::class);
2018-12-01 12:57:02 +00:00
new App(1, 'appKey', '', 'new');
2018-11-28 22:59:58 +00:00
}
/** @test */
public function it_will_not_accept_an_non_numeric_appId()
{
$this->expectException(InvalidClient::class);
2018-12-01 12:57:02 +00:00
new App('appId', 'appKey', '', 'new');
2018-11-28 22:59:58 +00:00
}
}