2019-06-27 23:03:10 +00:00
|
|
|
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
use BrunoFontes\Memsource;
|
|
|
|
|
|
|
|
final class ProjectTest extends TestCase
|
|
|
|
{
|
|
|
|
public function testNoTokenShouldThrowError()
|
|
|
|
{
|
2019-06-27 23:21:43 +00:00
|
|
|
$api = new Memsource();
|
|
|
|
$this->expectExceptionMessage('Missing Access Token');
|
2019-06-27 23:03:10 +00:00
|
|
|
$api->project()->list();
|
|
|
|
}
|
2019-06-27 23:21:43 +00:00
|
|
|
|
2019-06-27 23:03:10 +00:00
|
|
|
public function testInvalidProjectUidShouldThrowError()
|
|
|
|
{
|
|
|
|
$api = new Memsource('fakeToken');
|
|
|
|
$this->expectException(\Exception::class);
|
|
|
|
$api->project()->get('invalidProjectUid');
|
|
|
|
}
|
|
|
|
}
|