Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Propaganistas committed Dec 28, 2024
1 parent 2172362 commit a54bffa
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions tests/ValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -564,21 +564,23 @@ public function it_validates_libphonenumber_specific_regions_as_country()
}

#[Test]
public function it_validates_with_validator_alias()
public function it_resolves_validator_alias()
{
$this->assertTrue($this->validate(
['field' => '0470123456'],
['field' => ['phone:be,mobile']]
)->passes());

$this->assertFalse($this->validate(
['field' => '012345678'],
['field' => ['phone:nl']]
)->passes());
}

#[Test]
public function it_validates_with_rule_macro()
public function it_resolves_rule_macro()
{
$this->assertTrue($this->validate(
['field' => '0470123456'],
['field' => [Rule::phone()->country('BE')->type('mobile')]]
)->passes());
$this->assertEquals(new Phone, Rule::phone());
}

#[Test]
Expand Down

0 comments on commit a54bffa

Please sign in to comment.