Ergebnis bei *PHPStan* verbessert.

This commit is contained in:
2021-04-06 11:15:25 +02:00
parent 5cdc11d9df
commit d11070ffbb
2 changed files with 14 additions and 16 deletions
@@ -9,7 +9,7 @@ use Exception;
use InvalidArgumentException;
use PDO;
use PDOStatement;
use stdClass;
use TorstenHettstedt\TimekeepingApi\Models\ModelInterface;
use TorstenHettstedt\TimekeepingApi\Models\WorkingHours;
use TorstenHettstedt\TimekeepingApi\Repositories\RepositoryModelAlreadyExists;
use TorstenHettstedt\TimekeepingApi\Repositories\RepositoryRecordNotFoundException;
@@ -70,10 +70,7 @@ class WorkingHoursRepositoryTest extends Unit
public function testInsertWithInvalidModel(): void
{
$repository = new WorkingHoursRepository($this->pdoObject);
$model = $this->make(stdClass::class, [
'workingDay' => new DateTime(self::NEW_DATE),
'workingTime' => new DateInterval(self::NEW_INTERVAL),
]);
$model = $this->makeEmpty(ModelInterface::class);
$this->expectException(InvalidArgumentException::class);
$repository->insert($model);
}
@@ -118,10 +115,7 @@ class WorkingHoursRepositoryTest extends Unit
public function testDeleteWithInvalidModel(): void
{
$repository = new WorkingHoursRepository($this->pdoObject);
$model = $this->make(stdClass::class, [
'workingDay' => new DateTime(self::EXISTING_DATE),
'workingTime' => new DateInterval(self::EXISTING_INTERVAL),
]);
$model = $this->makeEmpty(ModelInterface::class);
$this->expectException(InvalidArgumentException::class);
$repository->delete($model);
}
@@ -164,11 +158,7 @@ class WorkingHoursRepositoryTest extends Unit
public function testUpdateWithInvalidModel(): void
{
$repository = new WorkingHoursRepository($this->pdoObject);
$model = $this->make(stdClass::class, [
'workingDay' => new DateTime(self::EXISTING_DATE),
'workingTime' => new DateInterval(self::NEW_INTERVAL),
]);
$model = $this->makeEmpty(ModelInterface::class);
$this->expectException(InvalidArgumentException::class);
$repository->update($model);
}