2020-06-30 00:01:17 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Zoomyboy\LaravelNami\Tests\Unit;
|
|
|
|
|
|
|
|
use Illuminate\Support\Facades\Config;
|
2022-02-18 18:29:02 +01:00
|
|
|
use Illuminate\Support\Facades\Http;
|
2020-06-30 00:01:17 +02:00
|
|
|
use Zoomyboy\LaravelNami\Group;
|
2022-02-18 18:29:02 +01:00
|
|
|
use Zoomyboy\LaravelNami\LoginException;
|
|
|
|
use Zoomyboy\LaravelNami\Nami;
|
|
|
|
use Zoomyboy\LaravelNami\NamiServiceProvider;
|
|
|
|
use Zoomyboy\LaravelNami\Tests\TestCase;
|
2020-06-30 00:01:17 +02:00
|
|
|
|
|
|
|
class PullConfessionTest extends TestCase
|
|
|
|
{
|
|
|
|
|
2022-02-18 18:29:02 +01:00
|
|
|
public function test_get_all_confessions(): void
|
|
|
|
{
|
|
|
|
Http::fake([
|
2020-06-30 00:01:17 +02:00
|
|
|
'https://nami.dpsg.de/ica/rest/baseadmin/konfession' => Http::response($this->fakeJson('confession.json'), 200)
|
2022-02-18 18:29:02 +01:00
|
|
|
]);
|
2020-06-30 00:01:17 +02:00
|
|
|
|
2022-02-18 18:29:02 +01:00
|
|
|
$confessions = $this->login()->confessions();
|
2020-06-30 00:01:17 +02:00
|
|
|
|
|
|
|
$this->assertEquals([
|
|
|
|
1 => 'römisch-katholisch'
|
2022-02-18 18:29:02 +01:00
|
|
|
], $confessions->pluck('name', 'id')->toArray());
|
2020-06-30 00:01:17 +02:00
|
|
|
|
2022-02-18 18:29:02 +01:00
|
|
|
Http::assertSentCount(1);
|
2020-06-30 00:01:17 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|