mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-01 11:04:34 -04:00
company gateways
This commit is contained in:
parent
3e3cde2e1e
commit
23265fb9e3
@ -23,7 +23,7 @@ use Tests\TestCase;
|
|||||||
/**
|
/**
|
||||||
* @test
|
* @test
|
||||||
*/
|
*/
|
||||||
class ClientApiTest extends TestCase
|
class CompanyGatewayApiTest extends TestCase
|
||||||
{
|
{
|
||||||
use MakesHash;
|
use MakesHash;
|
||||||
use DatabaseTransactions;
|
use DatabaseTransactions;
|
||||||
|
@ -67,4 +67,44 @@ class UploadLogoTest extends TestCase
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public function testLogoUploadfailure()
|
||||||
|
{
|
||||||
|
|
||||||
|
Storage::fake('avatars');
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'logo' => "",
|
||||||
|
'name' => 'TestCompany'
|
||||||
|
];
|
||||||
|
|
||||||
|
$response = $this->withHeaders([
|
||||||
|
'X-API-SECRET' => config('ninja.api_secret'),
|
||||||
|
'X-API-TOKEN' => $this->token,
|
||||||
|
])->put('/api/v1/companies/'.$this->encodePrimaryKey($this->company->id), $data);
|
||||||
|
|
||||||
|
$response->assertStatus(302);
|
||||||
|
|
||||||
|
//Log::error(print_r($response->json(),1));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function testLogoUploadNoAttribute()
|
||||||
|
{
|
||||||
|
|
||||||
|
Storage::fake('avatars');
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'name' => 'TestCompany'
|
||||||
|
];
|
||||||
|
|
||||||
|
$response = $this->withHeaders([
|
||||||
|
'X-API-SECRET' => config('ninja.api_secret'),
|
||||||
|
'X-API-TOKEN' => $this->token,
|
||||||
|
])->put('/api/v1/companies/'.$this->encodePrimaryKey($this->company->id), $data);
|
||||||
|
|
||||||
|
$response->assertStatus(200);
|
||||||
|
|
||||||
|
//Log::error(print_r($response->json(),1));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user