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-12-01 12:58:25 +00:00
|
|
|
use BeyondCode\LaravelWebSockets\Exceptions\InvalidApp;
|
2018-11-28 22:59:58 +00:00
|
|
|
use BeyondCode\LaravelWebSockets\Tests\TestCase;
|
|
|
|
|
|
2018-12-01 13:12:15 +00:00
|
|
|
class AppTest extends TestCase
|
2018-11-28 22:59:58 +00:00
|
|
|
{
|
|
|
|
|
/** @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()
|
|
|
|
|
{
|
2018-12-01 12:58:25 +00:00
|
|
|
$this->expectException(InvalidApp::class);
|
2018-11-28 22:59:58 +00:00
|
|
|
|
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()
|
|
|
|
|
{
|
2018-12-01 12:58:25 +00:00
|
|
|
$this->expectException(InvalidApp::class);
|
2018-11-28 22:59:58 +00:00
|
|
|
|
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()
|
|
|
|
|
{
|
2018-12-01 12:58:25 +00:00
|
|
|
$this->expectException(InvalidApp::class);
|
2018-11-28 22:59:58 +00:00
|
|
|
|
2018-12-01 12:57:02 +00:00
|
|
|
new App('appId', 'appKey', '', 'new');
|
2018-11-28 22:59:58 +00:00
|
|
|
}
|
|
|
|
|
}
|