Fixing a project Test

The test was to make sure it would return a error on No token, but it
was providing a token. More than that, it were a simple and direct check
if it were throwing an error.

Now it is checking for the specific Missing Access Token error message.
This commit is contained in:
Bruno F. Fontes 2019-06-27 20:21:43 -03:00
parent 51980ebf14
commit dc437d7044
Signed by: brunofontes
GPG Key ID: EE3447CE80048495

View File

@ -8,10 +8,11 @@ final class ProjectTest extends TestCase
{ {
public function testNoTokenShouldThrowError() public function testNoTokenShouldThrowError()
{ {
$api = new Memsource('fakeToken'); $api = new Memsource();
$this->expectException(\Exception::class); $this->expectExceptionMessage('Missing Access Token');
$api->project()->list(); $api->project()->list();
} }
public function testInvalidProjectUidShouldThrowError() public function testInvalidProjectUidShouldThrowError()
{ {
$api = new Memsource('fakeToken'); $api = new Memsource('fakeToken');