-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow toll-free numbers to be searched for
- Loading branch information
1 parent
5034d5e
commit a839b5c
Showing
5 changed files
with
60 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
# 2.9.0 | ||
|
||
### Changed | ||
|
||
* Nexmo/nexmo-laravel#62 - Landline Toll Free numbers can be searched for | ||
|
||
# 2.8.1 | ||
|
||
### Fixed | ||
|
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
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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
|
||
namespace VonageTest\Numbers\Filter; | ||
|
||
use InvalidArgumentException; | ||
use Vonage\Numbers\Number; | ||
use PHPUnit\Framework\TestCase; | ||
use Vonage\Numbers\Filter\AvailableNumbers; | ||
|
||
class AvailableNumbersTest extends TestCase | ||
{ | ||
/** | ||
* @dataProvider numberTypes | ||
*/ | ||
public function testCanSetValidNumberType(string $type): void | ||
{ | ||
$filter = new AvailableNumbers(); | ||
$filter->setType($type); | ||
|
||
$this->assertSame($type, $filter->getType()); | ||
} | ||
|
||
/** | ||
* List of valid number types that can be searched on | ||
* | ||
* @return array<array<string>> | ||
*/ | ||
public function numberTypes(): array | ||
{ | ||
return [ | ||
[Number::TYPE_FIXED], | ||
[Number::TYPE_MOBILE], | ||
[Number::TYPE_TOLLFREE] | ||
]; | ||
} | ||
|
||
public function testInvalidTypeThrowsException() | ||
{ | ||
$this->expectException(InvalidArgumentException::class); | ||
$this->expectExceptionMessage('Invalid type of number'); | ||
|
||
$filter = new AvailableNumbers(); | ||
$filter->setType('foo-bar'); | ||
} | ||
} |