Erweitere die Tests
This commit is contained in:
@@ -157,8 +157,9 @@ class WorkingHoursRepositoryTest extends Unit
|
||||
{
|
||||
$repository = new WorkingHoursRepository($this->pdoObject);
|
||||
$model = $this->make(WorkingHours::class, [
|
||||
'workingDay' => new DateTime(self::NEW_DATE),
|
||||
'workingTime' => new DateInterval(self::NEW_INTERVAL),
|
||||
'workingDay' => new DateTime(self::NEW_DATE),
|
||||
'workingTime' => new DateInterval(self::NEW_INTERVAL),
|
||||
'isHomeOffice' => false,
|
||||
]);
|
||||
$repository->insert($model);
|
||||
$model = $repository->findByKey(self::NEW_DATE);
|
||||
@@ -174,8 +175,9 @@ class WorkingHoursRepositoryTest extends Unit
|
||||
{
|
||||
$repository = new WorkingHoursRepository($this->pdoObject);
|
||||
$model = $this->make(WorkingHours::class, [
|
||||
'workingDay' => new DateTime(self::EXISTING_DATE),
|
||||
'workingTime' => new DateInterval(self::NEW_INTERVAL),
|
||||
'workingDay' => new DateTime(self::EXISTING_DATE),
|
||||
'workingTime' => new DateInterval(self::NEW_INTERVAL),
|
||||
'isHomeOffice' => false,
|
||||
]);
|
||||
$this->expectException(RepositoryRecordAlreadyExistException::class);
|
||||
$repository->insert($model);
|
||||
@@ -201,8 +203,9 @@ class WorkingHoursRepositoryTest extends Unit
|
||||
{
|
||||
$repository = new WorkingHoursRepository($this->pdoObject);
|
||||
$model = $this->make(WorkingHours::class, [
|
||||
'workingDay' => new DateTime(self::EXISTING_DATE),
|
||||
'workingTime' => new DateInterval(self::EXISTING_INTERVAL),
|
||||
'workingDay' => new DateTime(self::EXISTING_DATE),
|
||||
'workingTime' => new DateInterval(self::EXISTING_INTERVAL),
|
||||
'isHomeOffice' => false,
|
||||
]);
|
||||
$repository->delete($model);
|
||||
$this->expectException(RepositoryRecordNotFoundException::class);
|
||||
@@ -217,8 +220,9 @@ class WorkingHoursRepositoryTest extends Unit
|
||||
{
|
||||
$repository = new WorkingHoursRepository($this->pdoObject);
|
||||
$model = $this->make(WorkingHours::class, [
|
||||
'workingDay' => new DateTime(self::NEW_DATE),
|
||||
'workingTime' => new DateInterval(self::NEW_INTERVAL),
|
||||
'workingDay' => new DateTime(self::NEW_DATE),
|
||||
'workingTime' => new DateInterval(self::NEW_INTERVAL),
|
||||
'isHomeOffice' => false,
|
||||
]);
|
||||
$this->expectException(RepositoryRecordNotFoundException::class);
|
||||
$repository->delete($model);
|
||||
@@ -244,8 +248,9 @@ class WorkingHoursRepositoryTest extends Unit
|
||||
{
|
||||
$repository = new WorkingHoursRepository($this->pdoObject);
|
||||
$model = $this->make(WorkingHours::class, [
|
||||
'workingDay' => new DateTime(self::EXISTING_DATE),
|
||||
'workingTime' => new DateInterval(self::NEW_INTERVAL),
|
||||
'workingDay' => new DateTime(self::EXISTING_DATE),
|
||||
'workingTime' => new DateInterval(self::NEW_INTERVAL),
|
||||
'isHomeOffice' => false,
|
||||
]);
|
||||
$repository->update($model);
|
||||
$model_db = $repository->findByKey(self::EXISTING_DATE);
|
||||
@@ -259,8 +264,9 @@ class WorkingHoursRepositoryTest extends Unit
|
||||
{
|
||||
$repository = new WorkingHoursRepository($this->pdoObject);
|
||||
$model = $this->make(WorkingHours::class, [
|
||||
'workingDay' => new DateTime(self::NEW_DATE),
|
||||
'workingTime' => new DateInterval(self::NEW_INTERVAL),
|
||||
'workingDay' => new DateTime(self::NEW_DATE),
|
||||
'workingTime' => new DateInterval(self::NEW_INTERVAL),
|
||||
'isHomeOffice' => false,
|
||||
]);
|
||||
$this->expectException(RepositoryRecordNotFoundException::class);
|
||||
$repository->update($model);
|
||||
|
||||
Reference in New Issue
Block a user