2020-06-29 23:42:48 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Zoomyboy\LaravelNami\Tests\Unit;
|
|
|
|
|
2022-02-18 18:29:02 +01:00
|
|
|
use Illuminate\Support\Facades\Http;
|
|
|
|
use Zoomyboy\LaravelNami\Tests\TestCase;
|
2020-06-29 23:42:48 +02:00
|
|
|
|
|
|
|
class PullNationalityTest extends TestCase
|
|
|
|
{
|
2022-03-11 20:20:00 +01:00
|
|
|
public function testGetAllNationalities(): void
|
2022-02-18 18:29:02 +01:00
|
|
|
{
|
|
|
|
Http::fake([
|
2022-03-11 20:20:00 +01:00
|
|
|
'https://nami.dpsg.de/ica/rest/baseadmin/staatsangehoerigkeit' => Http::response($this->fakeJson('nationalities.json')),
|
2022-02-18 18:29:02 +01:00
|
|
|
]);
|
2020-06-29 23:42:48 +02:00
|
|
|
|
2022-02-18 18:29:02 +01:00
|
|
|
$nationalities = $this->login()->nationalities();
|
2020-06-29 23:42:48 +02:00
|
|
|
|
|
|
|
$this->assertEquals([
|
2022-03-11 20:20:00 +01:00
|
|
|
['name' => 'deutsch', 'id' => 1054],
|
2022-02-18 18:29:02 +01:00
|
|
|
], $nationalities->toArray());
|
2020-06-29 23:42:48 +02:00
|
|
|
|
2022-02-18 18:29:02 +01:00
|
|
|
Http::assertSentCount(1);
|
2020-06-29 23:42:48 +02:00
|
|
|
}
|
|
|
|
}
|