Skip to content

Commit

Permalink
Test Improvements (#54475)
Browse files Browse the repository at this point in the history
* Test Improvements

fixes tests failure introduced in #54425

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>

* wip

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>

---------

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
  • Loading branch information
crynobone authored Feb 5, 2025
1 parent 136a231 commit 43993ed
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions tests/Validation/ValidationNumericRuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function testGreaterThanRule()

public function testGreaterThanOrEqualRule()
{
$rule = Rule::numeric()->greaterThanOrEqual('some_field');
$rule = Rule::numeric()->greaterThanOrEqualTo('some_field');
$this->assertEquals('numeric|gte:some_field', (string) $rule);
}

Expand All @@ -82,7 +82,7 @@ public function testLessThanRule()

public function testLessThanOrEqualRule()
{
$rule = Rule::numeric()->lessThanOrEqual('some_field');
$rule = Rule::numeric()->lessThanOrEqualTo('some_field');
$this->assertEquals('numeric|lte:some_field', (string) $rule);
}

Expand Down Expand Up @@ -139,7 +139,7 @@ public function testChainedRules()
$rule = Rule::numeric()
->integer()
->multipleOf(10)
->lessThanOrEqual('some_field')
->lessThanOrEqualTo('some_field')
->max(100);
$this->assertEquals('numeric|integer|multiple_of:10|lte:some_field|max:100', (string) $rule);

Expand Down Expand Up @@ -229,7 +229,7 @@ public function testNumericValidation()

$this->assertEmpty($validator->errors()->first('numeric'));

$rule = Rule::numeric()->greaterThanOrEqual('some_field');
$rule = Rule::numeric()->greaterThanOrEqualTo('some_field');

$validator = new Validator(
$trans,
Expand Down Expand Up @@ -259,7 +259,7 @@ public function testNumericValidation()

$this->assertEmpty($validator->errors()->first('numeric'));

$rule = Rule::numeric()->lessThanOrEqual('some_field');
$rule = Rule::numeric()->lessThanOrEqualTo('some_field');

$validator = new Validator(
$trans,
Expand Down Expand Up @@ -329,7 +329,7 @@ public function testNumericValidation()

$this->assertEmpty($validator->errors()->first('numeric'));

$rule = Rule::numeric()->size(10);
$rule = Rule::numeric()->exactly(10);

$validator = new Validator(
$trans,
Expand All @@ -342,7 +342,7 @@ public function testNumericValidation()

public function testUniquenessValidation()
{
$rule = Rule::numeric()->integer()->digits(2)->size(2);
$rule = Rule::numeric()->integer()->digits(2)->exactly(2);
$this->assertEquals('numeric|integer|digits:2|size:2', (string) $rule);
}
}
4 changes: 2 additions & 2 deletions types/Support/LazyCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -398,12 +398,12 @@ public function toArray(): array

return true;
}));
assertType('string|User', $collection->last(function ($user) {
assertType("'string'|User", $collection->last(function ($user) {
assertType('User', $user);

return false;
}, 'string'));
assertType('string|User', $collection->last(null, function () {
assertType("'string'|User", $collection->last(null, function () {
return 'string';
}));

Expand Down

0 comments on commit 43993ed

Please sign in to comment.