Skip to content

Commit

Permalink
Merge pull request #103 from demvsystems/neue-bedarfsthemen
Browse files Browse the repository at this point in the history
Neue Bedarfsthemen hinzugefügt
  • Loading branch information
kenowessels authored Mar 2, 2018
2 parents 0fb1d00 + 24d8657 commit d72810b
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/Werte/Bedarf/Thema/Bedarfsthemen.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
namespace Demv\Werte\Bedarf\Thema;

use Demv\Werte\AbstractProvider;
use Demv\Werte\Bedarf\Thema\Themen\Altersvorsorge;
use Demv\Werte\Bedarf\Thema\Themen\Berufsunfaehigkeit;
use Demv\Werte\Bedarf\Thema\Themen\PrivateKrankenversicherung;
use Demv\Werte\Bedarf\Thema\Themen\Risikoleben;
use Demv\Werte\Exception\EntryNotFoundException;

/**
* Class Bedarfsthemen
Expand All @@ -19,6 +22,8 @@ public function __construct()
{
$this->appendMember(new Berufsunfaehigkeit());
$this->appendMember(new PrivateKrankenversicherung());
$this->appendMember(new Risikoleben());
$this->appendMember(new Altersvorsorge());
}

/**
Expand All @@ -33,6 +38,7 @@ public function getAll(): array
* @param int $id
*
* @return BedarfthemaInterface
* @throws EntryNotFoundException
*/
public function getOne(int $id): BedarfthemaInterface
{
Expand Down
23 changes: 23 additions & 0 deletions src/Werte/Bedarf/Thema/Themen/Altersvorsorge.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

namespace Demv\Werte\Bedarf\Thema\Themen;

use Demv\Werte\Bedarf\Thema\Bedarfsthema;
use Demv\Werte\Sparte\Sparten\Vorsorge;

/**
* Class Altersvorsorge
* @package Demv\Werte\Bedarf\Thema\Themen
*/
final class Altersvorsorge extends Bedarfsthema
{
const ID = 4;

/**
* Altersvorsorge constructor.
*/
public function __construct()
{
parent::__construct(self::ID, 'Altersvorsorge', [Vorsorge::ALTERSVORSORGE]);
}
}
23 changes: 23 additions & 0 deletions src/Werte/Bedarf/Thema/Themen/Risikoleben.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

namespace Demv\Werte\Bedarf\Thema\Themen;

use Demv\Werte\Bedarf\Thema\Bedarfsthema;
use Demv\Werte\Sparte\Sparten\Vorsorge;

/**
* Class Risikoleben
* @package Demv\Werte\Bedarf\Thema\Themen
*/
final class Risikoleben extends Bedarfsthema
{
const ID = 3;

/**
* RisikoLeben constructor.
*/
public function __construct()
{
parent::__construct(self::ID, 'Risikolebensversicherung', [Vorsorge::RISIKOLEBEN]);
}
}
14 changes: 13 additions & 1 deletion tests/Werte/Bedarf/Thema/BedarfsthemenTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
namespace Demv\Werte\Tests\Bedarf\Thema;

use Demv\Werte\Bedarf\Thema\Bedarfsthemen;
use Demv\Werte\Bedarf\Thema\Themen\Altersvorsorge;
use Demv\Werte\Bedarf\Thema\Themen\Berufsunfaehigkeit;
use Demv\Werte\Bedarf\Thema\Themen\PrivateKrankenversicherung;
use Demv\Werte\Bedarf\Thema\Themen\Risikoleben;
use Demv\Werte\Tests\ProviderTestTrait;
use PHPUnit\Framework\TestCase;

Expand All @@ -27,7 +29,7 @@ private function getBedarfsthemen(): Bedarfsthemen
public function testGetAll(): void
{
$themen = $this->getBedarfsthemen();
$this->assertCount(2, $themen->getAll());
$this->assertCount(4, $themen->getAll());
}

public function testGetBerufsunfaehigkeit(): void
Expand All @@ -39,4 +41,14 @@ public function testGetPKV(): void
{
$this->checkGetOne($this->getBedarfsthemen(), PrivateKrankenversicherung::class);
}

public function testGetRisikoleben(): void
{
$this->checkGetOne($this->getBedarfsthemen(), Risikoleben::class);
}

public function testGetAltersVorsorge(): void
{
$this->checkGetOne($this->getBedarfsthemen(), Altersvorsorge::class);
}
}

0 comments on commit d72810b

Please sign in to comment.