1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00

Tests for basetransformer

This commit is contained in:
David Bomba 2022-02-01 17:56:13 +11:00
parent e2173d979a
commit 973a25b834

View File

@ -102,13 +102,28 @@ class BaseTransformerTest extends TestCase
$this->assertEquals($client->id, $base_transformer->getClient('hit', 'null'));
$this->assertEquals($client->id, $base_transformer->getClient('magic', 'null'));
$this->assertEquals($client->id, $base_transformer->getClient('nomagic', 'test@gmail.com'));
$this->assertEquals($client->id, $base_transformer->getClient(null, 'test@gmail.com'));
$this->assertNull($base_transformer->getClient('null', 'notest@gmail.com'));
}
public function testHasClient()
{
$base_transformer = new BaseTransformer($this->company);
$client = Client::factory()->create([
'user_id' => $this->user->id,
'company_id' => $this->company->id,
'id_number' => 'hit',
'name' => 'magic ',
]);
$this->assertTrue($base_transformer->hasClient("magic"));
$this->assertTrue($base_transformer->hasClient("Magic"));
$this->assertTrue($base_transformer->hasClient("Ma gi c "));
}
// public function testClientCsvImport()