From 23265fb9e3caef8c5b0480b304b25bac4c013360 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 3 Oct 2019 14:27:17 +1000 Subject: [PATCH] company gateways --- tests/Feature/CompanyGatewayApiTest.php | 2 +- tests/Integration/UploadLogoTest.php | 40 +++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/tests/Feature/CompanyGatewayApiTest.php b/tests/Feature/CompanyGatewayApiTest.php index 2b9eab80b008..ffe441ca65c8 100644 --- a/tests/Feature/CompanyGatewayApiTest.php +++ b/tests/Feature/CompanyGatewayApiTest.php @@ -23,7 +23,7 @@ use Tests\TestCase; /** * @test */ -class ClientApiTest extends TestCase +class CompanyGatewayApiTest extends TestCase { use MakesHash; use DatabaseTransactions; diff --git a/tests/Integration/UploadLogoTest.php b/tests/Integration/UploadLogoTest.php index c647776317e4..bb3347849ddb 100644 --- a/tests/Integration/UploadLogoTest.php +++ b/tests/Integration/UploadLogoTest.php @@ -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)); + } + } \ No newline at end of file