Ergebnis bei *PHPStan* verbessert.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user