diff --git a/app/Services/FlowTester/ResponseValidator.php b/app/Services/FlowTester/ResponseValidator.php index c1f2a869..b55cefd9 100644 --- a/app/Services/FlowTester/ResponseValidator.php +++ b/app/Services/FlowTester/ResponseValidator.php @@ -13,6 +13,7 @@ * - @isNumber: 숫자 타입 체크 * - @isString: 문자열 타입 체크 * - @isArray: 배열 타입 체크 + * - @isObject: 객체(연관 배열) 타입 체크 * - @isBoolean: 불리언 타입 체크 * - @minLength:N: 최소 길이 (배열/문자열) * - @maxLength:N: 최대 길이 (배열/문자열) @@ -119,6 +120,7 @@ private function validateValue(mixed $actual, mixed $expected, string $path): ?s $operator === 'isString' => ! is_string($actual) ? "Path {$path}: expected string, got ".gettype($actual) : null, $operator === 'isArray' => ! is_array($actual) ? "Path {$path}: expected array, got ".gettype($actual) : null, $operator === 'isBoolean' => ! is_bool($actual) ? "Path {$path}: expected boolean, got ".gettype($actual) : null, + $operator === 'isObject' => ! is_array($actual) || array_is_list($actual) ? "Path {$path}: expected object, got ".(is_array($actual) ? 'array' : gettype($actual)) : null, $operator === 'isNull' => $actual !== null ? "Path {$path}: expected null, got ".gettype($actual) : null, $operator === 'notNull' => $actual === null ? "Path {$path}: expected not null" : null, $operator === 'isEmpty' => ! empty($actual) ? "Path {$path}: expected empty" : null,