- added CzechRegisterSearchService

- oasis RouteServiceProvider.php
- oasis admincontroller
This commit is contained in:
Peter Papp
2021-03-22 08:19:50 +01:00
parent 4999b23474
commit 80b24cd753
5 changed files with 352 additions and 0 deletions
+49
View File
@@ -0,0 +1,49 @@
<?php
namespace Tests\Feature\Oasis;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Support\Facades\Http;
use Tests\TestCase;
class OasisAdminTest extends TestCase
{
use DatabaseMigrations;
/**
* @test
*/
public function it_get_register_by_ico()
{
$response = [
"name" => "GDPR Cloud Solution, s.r.o.",
"ico" => "08995281",
"city" => "Praha",
"addr_city" => "Praha 5",
"addr_zip" => "15900",
"addr_streetnr" => "Zbraslavská 12/11",
"addr_full" => "Zbraslavská 12/11, Malá Chuchle, 159 00 Praha 5",
];
Http::fake([
'https://or.justice.cz/ias/ui/rejstrik-08995281' => Http::response($response, 200),
]);
$this->getJson('/api/oasis/admin/company-details?ico=08995281')
->assertStatus(200)
->assertExactJson($response);
}
/**
* @test
*/
public function it_try_to_get_register_by_ico_with_not_found_result()
{
Http::fake([
'https://or.justice.cz/ias/ui/rejstrik-0899528199' => Http::response([], 200),
]);
$this->getJson('/api/oasis/admin/company-details?ico=0899528199')
->assertNotFound();
}
}