Fix annotations, remove groups
This commit is contained in:
parent
d3e12785bb
commit
aa7b062b29
3 changed files with 13 additions and 42 deletions
|
|
@ -38,7 +38,7 @@ describe('primitive data test', function () {
|
|||
expect($object->float)->toEqualWithDelta(3.14, 0.0001);
|
||||
expect($object->bool)->toBeTrue();
|
||||
});
|
||||
})->group('primitives');
|
||||
});
|
||||
|
||||
describe('optional data', function () {
|
||||
it('creates optional rules', function () {
|
||||
|
|
@ -59,7 +59,7 @@ describe('optional data', function () {
|
|||
expect($object->float)->toEqualWithDelta(0.777, 0.0001);
|
||||
expect($object->bool)->toBeFalse();
|
||||
});
|
||||
})->group('optional');
|
||||
});
|
||||
|
||||
describe('nullable data', function () {
|
||||
it('creates nullable rules', function () {
|
||||
|
|
@ -88,7 +88,7 @@ describe('nullable data', function () {
|
|||
expect($object->string)->toBe('dfg');
|
||||
expect($object->int)->toBeNull();
|
||||
});
|
||||
})->group('nullable');
|
||||
});
|
||||
|
||||
describe('reference other DataObject', function () {
|
||||
|
||||
|
|
@ -105,7 +105,7 @@ describe('reference other DataObject', function () {
|
|||
'extra.bool' => ['required', 'boolean'],
|
||||
]);
|
||||
});
|
||||
})->group('reference');
|
||||
});
|
||||
|
||||
describe('primitive array', function () {
|
||||
it('creates array rules', function () {
|
||||
|
|
@ -115,7 +115,7 @@ describe('primitive array', function () {
|
|||
'values.*' => ['required', 'numeric'],
|
||||
]);
|
||||
});
|
||||
})->group('primitive-array');
|
||||
});
|
||||
|
||||
|
||||
describe('object array', function () {
|
||||
|
|
@ -133,7 +133,7 @@ describe('object array', function () {
|
|||
'values.*.bool' => ['sometimes', 'boolean'],
|
||||
]);
|
||||
});
|
||||
})->group('object-array');
|
||||
});
|
||||
|
||||
describe('can map input names', function () {
|
||||
|
||||
|
|
@ -164,7 +164,7 @@ describe('can map input names', function () {
|
|||
expect($object->text)->toBe('xyz');
|
||||
expect($object->standard)->toBe(1);
|
||||
});
|
||||
})->group('input-map');
|
||||
});
|
||||
|
||||
describe('with mapper object', function () {
|
||||
it('uses mapper', function () {
|
||||
|
|
@ -187,7 +187,7 @@ describe('with mapper object', function () {
|
|||
'standard' => 1,
|
||||
]);
|
||||
})->throws(ValidationException::class);
|
||||
})->group('mapper-object');
|
||||
});
|
||||
|
||||
test('failed validation throws ValidationException', function () {
|
||||
$object = PrimitiveData::fromArray([
|
||||
|
|
@ -195,8 +195,7 @@ test('failed validation throws ValidationException', function () {
|
|||
'float' => 3.14,
|
||||
'bool' => true,
|
||||
]);
|
||||
})->throws(ValidationException::class)
|
||||
->group('error');
|
||||
})->throws(ValidationException::class);
|
||||
|
||||
|
||||
test('tries to resolve without mapper', function () {
|
||||
|
|
@ -221,4 +220,4 @@ test('creates collection', function () {
|
|||
expect($object->values->count())->toBe(2);
|
||||
expect($object->values[0]->string)->toBe('x');
|
||||
expect($object->values[1]->int)->toBeNull();
|
||||
})->group('collection');
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue