File tree Expand file tree Collapse file tree 4 files changed +39
-2
lines changed Expand file tree Collapse file tree 4 files changed +39
-2
lines changed Original file line number Diff line number Diff line change @@ -921,7 +921,7 @@ $filter
921921 ->setPattern(234)
922922 ->setSearchPattern(\Vonage\Numbers\Filter\OwnedNumbers::SEARCH_PATTERN_CONTAINS)
923923;
924- $response = $client->numbers()->searchOwned($filter);
924+ $response = $client->numbers()->searchOwned(null, $filter);
925925```
926926
927927` has_application ` :
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ class OwnedNumbers implements FilterInterface
3838
3939 protected int $ pageIndex = 1 ;
4040
41- protected string $ pattern ;
41+ protected ? string $ pattern = null ;
4242
4343 protected int $ searchPattern = 0 ;
4444
Original file line number Diff line number Diff line change @@ -361,6 +361,27 @@ public function testPurchaseNumberWithNumberObject(): void
361361 // If there's no exception thrown, everything is fine!
362362 }
363363
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+
364385 public function testPurchaseNumberWithNumberAndCountry (): void
365386 {
366387 // 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