2025-04-29 23:55:51 -04:00
|
|
|
<?php
|
2025-05-08 11:13:17 -04:00
|
|
|
namespace Tests\Extension;
|
2025-04-29 23:55:51 -04:00
|
|
|
|
|
|
|
use Incoviba\Common\Define\Model;
|
|
|
|
|
|
|
|
trait testPropertiesTrait
|
|
|
|
{
|
|
|
|
use ObjectHasMethodTrait;
|
|
|
|
|
|
|
|
public function testProperties(): void
|
|
|
|
{
|
|
|
|
$model = $this->model;
|
|
|
|
|
|
|
|
$this->assertProperties($model);
|
|
|
|
}
|
|
|
|
|
|
|
|
protected array $properties = [];
|
|
|
|
protected function assertProperties(Model $model): void
|
|
|
|
{
|
|
|
|
foreach ($this->properties as $key) {
|
|
|
|
$this->assertObjectHasProperty($key, $model);
|
|
|
|
}
|
|
|
|
}
|
2025-05-08 11:13:17 -04:00
|
|
|
}
|