-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #107 from demvsystems/anlegerorientierungen
Added AnlegerOrientierungen
- Loading branch information
Showing
8 changed files
with
197 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
namespace Demv\Werte\Altersvorsorge; | ||
|
||
use Demv\Werte\ValueInterface; | ||
|
||
/** | ||
* Class AnlegerOrientierungInterface | ||
* @package Demv\Werte\Altersvorsorge | ||
*/ | ||
interface AnlegerOrientierungInterface extends ValueInterface | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
namespace Demv\Werte\Altersvorsorge; | ||
|
||
use Demv\Werte\AbstractProvider; | ||
use Demv\Werte\Altersvorsorge\AnlegerOrientierungen\Konservativ; | ||
use Demv\Werte\Altersvorsorge\AnlegerOrientierungen\Risikoorientiert; | ||
use Demv\Werte\Altersvorsorge\AnlegerOrientierungen\Sicherheitsorientiert; | ||
use Demv\Werte\Altersvorsorge\AnlegerOrientierungen\Wachstumsorientiert; | ||
use Demv\Werte\Exception\EntryNotFoundException; | ||
|
||
/** | ||
* Class AnlegerOrientierungen | ||
* @package Demv\Werte\Altersvorsorge | ||
*/ | ||
final class AnlegerOrientierungen extends AbstractProvider | ||
{ | ||
public function __construct() | ||
{ | ||
$this->appendMember(new Sicherheitsorientiert()); | ||
$this->appendMember(new Konservativ()); | ||
$this->appendMember(new Wachstumsorientiert()); | ||
$this->appendMember(new Risikoorientiert()); | ||
} | ||
|
||
/** | ||
* @param int $id | ||
* | ||
* @return AnlegerOrientierungInterface | ||
* @throws EntryNotFoundException | ||
*/ | ||
public function getOne(int $id): AnlegerOrientierungInterface | ||
{ | ||
return parent::getOne($id); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
src/Werte/Altersvorsorge/AnlegerOrientierungen/Konservativ.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
namespace Demv\Werte\Altersvorsorge\AnlegerOrientierungen; | ||
|
||
use Demv\Werte\Altersvorsorge\AnlegerOrientierungInterface; | ||
use Demv\Werte\Value; | ||
|
||
/** | ||
* Class Konservativ | ||
* @package Demv\Werte\Altersvorsorge\AnlegerOrientierungen | ||
*/ | ||
final class Konservativ extends Value implements AnlegerOrientierungInterface | ||
{ | ||
const ID = 2; | ||
|
||
public function __construct() | ||
{ | ||
parent::__construct(self::ID, 'Konservativ'); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
src/Werte/Altersvorsorge/AnlegerOrientierungen/Risikoorientiert.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
namespace Demv\Werte\Altersvorsorge\AnlegerOrientierungen; | ||
|
||
use Demv\Werte\Altersvorsorge\AnlegerOrientierungInterface; | ||
use Demv\Werte\Value; | ||
|
||
/** | ||
* Class Risikoorientiert | ||
* @package Demv\Werte\Altersvorsorge\AnlegerOrientierungen | ||
*/ | ||
final class Risikoorientiert extends Value implements AnlegerOrientierungInterface | ||
{ | ||
const ID = 4; | ||
|
||
public function __construct() | ||
{ | ||
parent::__construct(self::ID, 'Risikoorientiert'); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
src/Werte/Altersvorsorge/AnlegerOrientierungen/Sicherheitsorientiert.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
namespace Demv\Werte\Altersvorsorge\AnlegerOrientierungen; | ||
|
||
use Demv\Werte\Altersvorsorge\AnlegerOrientierungInterface; | ||
use Demv\Werte\Value; | ||
|
||
/** | ||
* Class Sicherheitsorientiert | ||
* @package Demv\Werte\Altersvorsorge\AnlegerOrientierungen | ||
*/ | ||
final class Sicherheitsorientiert extends Value implements AnlegerOrientierungInterface | ||
{ | ||
const ID = 1; | ||
|
||
public function __construct() | ||
{ | ||
parent::__construct(self::ID, 'Sicherheitsorientiert'); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
src/Werte/Altersvorsorge/AnlegerOrientierungen/Wachstumsorientiert.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
namespace Demv\Werte\Altersvorsorge\AnlegerOrientierungen; | ||
|
||
use Demv\Werte\Altersvorsorge\AnlegerOrientierungInterface; | ||
use Demv\Werte\Value; | ||
|
||
/** | ||
* Class Wachstumsorientiert | ||
* @package Demv\Werte\Altersvorsorge\AnlegerOrientierungen | ||
*/ | ||
final class Wachstumsorientiert extends Value implements AnlegerOrientierungInterface | ||
{ | ||
const ID = 3; | ||
|
||
public function __construct() | ||
{ | ||
parent::__construct(self::ID, 'Wachstumsorientiert'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?php | ||
|
||
namespace Demv\Werte\Tests\Altersvorsorge; | ||
|
||
use Demv\Werte\Altersvorsorge\AnlegerOrientierungen; | ||
use Demv\Werte\Altersvorsorge\AnlegerOrientierungen\Konservativ; | ||
use Demv\Werte\Altersvorsorge\AnlegerOrientierungen\Risikoorientiert; | ||
use Demv\Werte\Altersvorsorge\AnlegerOrientierungen\Sicherheitsorientiert; | ||
use Demv\Werte\Altersvorsorge\AnlegerOrientierungen\Wachstumsorientiert; | ||
use Demv\Werte\Exception\EntryNotFoundException; | ||
use Demv\Werte\Tests\ProviderTestTrait; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
/** | ||
* Class AnlegerOrientierungenTest | ||
* @package Demv\Werte\Tests\Altersvorsorge | ||
*/ | ||
final class AnlegerOrientierungenTest extends TestCase | ||
{ | ||
use ProviderTestTrait; | ||
|
||
/** | ||
* @return AnlegerOrientierungen | ||
*/ | ||
private function getAnlegerOrientierungen(): AnlegerOrientierungen | ||
{ | ||
return new AnlegerOrientierungen(); | ||
} | ||
|
||
public function testGetAll(): void | ||
{ | ||
$adressTypen = $this->getAnlegerOrientierungen(); | ||
$this->assertCount(4, $adressTypen->getAll()); | ||
} | ||
|
||
public function testGetsicherheitsorientiert(): void | ||
{ | ||
$this->checkGetOne($this->getAnlegerOrientierungen(), Sicherheitsorientiert::class); | ||
} | ||
|
||
public function testGetKonservativ(): void | ||
{ | ||
$this->checkGetOne($this->getAnlegerOrientierungen(), Konservativ::class); | ||
} | ||
|
||
public function testGetWachstumsorientiert(): void | ||
{ | ||
$this->checkGetOne($this->getAnlegerOrientierungen(), Wachstumsorientiert::class); | ||
} | ||
|
||
public function testGetRisikoorientiert(): void | ||
{ | ||
$this->checkGetOne($this->getAnlegerOrientierungen(), Risikoorientiert::class); | ||
} | ||
|
||
/** | ||
* @throws EntryNotFoundException | ||
*/ | ||
public function testNotFound(): void | ||
{ | ||
$this->expectException(EntryNotFoundException::class); | ||
$this->getAnlegerOrientierungen()->getOne(5); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters