mirror of
https://github.com/brunofontes/Memsource-API.git
synced 2024-11-24 03:07:10 +00:00
Bruno Fontes
c88478f7d8
It is important to choose the file extension, so including it on the filename would be the easier way for us, as we already have the extension when using it.
38 lines
1.1 KiB
PHP
38 lines
1.1 KiB
PHP
<?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.xliff')
|
|
);
|
|
}
|
|
public function testInvalidDownloadUidsShouldThrowError()
|
|
{
|
|
$api = new Memsource('fakeToken');
|
|
$this->expectException(\Exception::class);
|
|
$api->bilingualFile()->download('uid', ['a'], 'filename.xliff');
|
|
}
|
|
|
|
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', []);
|
|
}
|
|
}
|