File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,11 @@ public function getType()
7070 return $ this ->fromData ('type ' );
7171 }
7272
73+ public function getCost ()
74+ {
75+ return $ this ->fromData ('cost ' );
76+ }
77+
7378 public function hasFeature ($ feature )
7479 {
7580 if (!isset ($ this ->data ['features ' ])){
Original file line number Diff line number Diff line change @@ -63,6 +63,25 @@ public function testHydrate()
6363 $ this ->assertCount (2 , $ this ->number ->getFeatures ());
6464 }
6565
66+ public function testAvailableNumbers ()
67+ {
68+ $ data = json_decode (file_get_contents (__DIR__ . '/responses/available-numbers.json ' ), true );
69+ $ this ->number ->jsonUnserialize ($ data ['numbers ' ][0 ]);
70+
71+ $ this ->assertEquals ('US ' , $ this ->number ->getCountry ());
72+ $ this ->assertEquals ('14155550100 ' , $ this ->number ->getNumber ());
73+ $ this ->assertEquals (Number::TYPE_MOBILE , $ this ->number ->getType ());
74+ $ this ->assertEquals ('0.67 ' , $ this ->number ->getCost ());
75+
76+ $ this ->assertTrue ($ this ->number ->hasFeature (Number::FEATURE_VOICE ));
77+ $ this ->assertTrue ($ this ->number ->hasFeature (Number::FEATURE_SMS ));
78+
79+ $ this ->assertTrue (in_array (Number::FEATURE_VOICE , $ this ->number ->getFeatures ()));
80+ $ this ->assertTrue (in_array (Number::FEATURE_SMS , $ this ->number ->getFeatures ()));
81+
82+ $ this ->assertCount (2 , $ this ->number ->getFeatures ());
83+ }
84+
6685 public function testVoiceApplication ()
6786 {
6887 $ id = 'abcd-1234-edfg ' ;
You can’t perform that action at this time.
0 commit comments