mirror of
https://github.com/brunofontes/Memsource-API.git
synced 2025-11-17 02:30:54 -03:00
Including Tests and verifications for errors
This commit is contained in:
37
tests/bilingualFileTest.php
Normal file
37
tests/bilingualFileTest.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use BrunoFontes\Memsource;
|
||||
|
||||
final class BilingualFileTest extends TestCase
|
||||
{
|
||||
public function testEmptyDownloadJobUidListShouldReturnEmptyFilenames()
|
||||
{
|
||||
$api = new Memsource('fakeToken');
|
||||
$this->assertEquals(
|
||||
[],
|
||||
$api->bilingualFile()->download('uid', [], 'filename')
|
||||
);
|
||||
}
|
||||
public function testInvalidDownloadUidsShouldThrowError()
|
||||
{
|
||||
$api = new Memsource('fakeToken');
|
||||
$this->expectException(\Exception::class);
|
||||
$api->bilingualFile()->download('uid', ['a'], 'filename');
|
||||
}
|
||||
|
||||
public function testUploadInexistentFileShouldThrowError()
|
||||
{
|
||||
$api = new Memsource('fakeToken');
|
||||
$this->expectException(\Exception::class);
|
||||
$api->bilingualFile()->upload('myInvalidFile', []);
|
||||
}
|
||||
|
||||
public function testUploadWithNoTokenShouldThrowError()
|
||||
{
|
||||
$api = new Memsource('fakeToken');
|
||||
$this->expectException(\Exception::class);
|
||||
$api->bilingualFile()->upload('tests/bilingualFileTest.php', []);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user