File tree 4 files changed +39
-2
lines changed
4 files changed +39
-2
lines changed Original file line number Diff line number Diff line change @@ -921,7 +921,7 @@ $filter
921
921
->setPattern(234)
922
922
->setSearchPattern(\Vonage\Numbers\Filter\OwnedNumbers::SEARCH_PATTERN_CONTAINS)
923
923
;
924
- $response = $client->numbers()->searchOwned($filter);
924
+ $response = $client->numbers()->searchOwned(null, $filter);
925
925
```
926
926
927
927
` has_application ` :
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ class OwnedNumbers implements FilterInterface
38
38
39
39
protected int $ pageIndex = 1 ;
40
40
41
- protected string $ pattern ;
41
+ protected ? string $ pattern = null ;
42
42
43
43
protected int $ searchPattern = 0 ;
44
44
Original file line number Diff line number Diff line change @@ -361,6 +361,27 @@ public function testPurchaseNumberWithNumberObject(): void
361
361
// If there's no exception thrown, everything is fine!
362
362
}
363
363
364
+ public function testSearchOwnedNumbersWithFilter (): void
365
+ {
366
+ $ this ->vonageClient ->send (Argument::that (function (RequestInterface $ request ) {
367
+ $ uri = $ request ->getUri ();
368
+ $ uriString = $ uri ->__toString ();
369
+ $ this ->assertEquals (
370
+ 'https://rest.nexmo.com/account/numbers?size=10&index=1&application_id=66c04cea-68b2-45e4-9061-3fd847d627b8&page_index=1 ' ,
371
+ $ uriString
372
+ );
373
+
374
+ $ this ->assertEquals ('GET ' , $ request ->getMethod ());
375
+
376
+ return true ;
377
+ }))->willReturn ($ this ->getResponse ('owned-numbers ' ));
378
+
379
+ $ filter = new \Vonage \Numbers \Filter \OwnedNumbers ();
380
+ $ filter ->setApplicationId ("66c04cea-68b2-45e4-9061-3fd847d627b8 " );
381
+
382
+ $ response = $ this ->numberClient ->searchOwned (null , $ filter );
383
+ }
384
+
364
385
public function testPurchaseNumberWithNumberAndCountry (): void
365
386
{
366
387
// When providing a number string, the first thing that happens is a GET request to fetch number details
Original file line number Diff line number Diff line change
1
+ {
2
+ "count" : 1234 ,
3
+ "numbers" : [
4
+ {
5
+ "country" : " GB" ,
6
+ "msisdn" : " 447700900000" ,
7
+ "type" : " mobile-lvn" ,
8
+ "cost" : " 1.25" ,
9
+ "features" : [
10
+ " VOICE" ,
11
+ " SMS" ,
12
+ " MMS"
13
+ ]
14
+ }
15
+ ]
16
+ }
You can’t perform that action at this time.
0 commit comments