2020-06-29 23:12:16 +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:12:16 +02:00
|
|
|
|
|
|
|
class PullGenderTest extends TestCase
|
|
|
|
{
|
2022-03-11 20:20:00 +01:00
|
|
|
public function testGetAllGenders(): 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/geschlecht' => Http::response($this->fakeJson('genders.json'), 200),
|
2022-02-18 18:29:02 +01:00
|
|
|
]);
|
2020-06-29 23:12:16 +02:00
|
|
|
|
2022-02-18 18:29:02 +01:00
|
|
|
$genders = $this->login()->genders();
|
2020-06-29 23:12:16 +02:00
|
|
|
|
|
|
|
$this->assertEquals([
|
|
|
|
19 => 'Männlich',
|
2022-03-11 20:20:00 +01:00
|
|
|
20 => 'Weiblich',
|
2022-02-18 18:29:02 +01:00
|
|
|
], $genders->pluck('name', 'id')->toArray());
|
2020-06-29 23:12:16 +02:00
|
|
|
|
2022-02-18 18:29:02 +01:00
|
|
|
Http::assertSentCount(1);
|
2020-06-29 23:12:16 +02:00
|
|
|
}
|
|
|
|
}
|