-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #53 from mrk-j/add-support-for-tel-scheme
Add support for tel: links
- Loading branch information
Showing
4 changed files
with
29 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,4 +38,12 @@ public function it_can_check_if_it_contains_a_mailto() | |
|
||
$this->assertTrue($url->matches(Url::fromString('mailto:[email protected]'))); | ||
} | ||
|
||
/** @test */ | ||
public function it_can_check_if_it_contains_a_tel() | ||
{ | ||
$url = Url::fromString('tel:+3112345678'); | ||
|
||
$this->assertTrue($url->matches(Url::fromString('tel:+3112345678'))); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,6 +40,22 @@ public function it_can_parse_a_path_with_mailto() | |
$this->assertEquals('[email protected]', $url->getPath()); | ||
} | ||
|
||
/** @test */ | ||
public function it_can_parse_a_scheme_with_tel() | ||
{ | ||
$url = Url::fromString('tel:+3112345678'); | ||
|
||
$this->assertEquals('tel', $url->getScheme()); | ||
} | ||
|
||
/** @test */ | ||
public function it_can_parse_a_path_withtel() | ||
{ | ||
$url = Url::fromString('tel:+3112345678'); | ||
|
||
$this->assertEquals('+3112345678', $url->getPath()); | ||
} | ||
|
||
/** @test */ | ||
public function it_throws_an_exception_if_an_invalid_scheme_is_provided() | ||
{ | ||
|