@@ -34,21 +34,21 @@ class VerificationTest extends TestCase
3434 /**
3535 * @var Verification
3636 */
37- protected $ exsisting ;
37+ protected $ existing ;
3838
3939 /**
4040 * Create a basic verification object
4141 */
4242 public function setUp ()
4343 {
4444 $ this ->verification = new Verification ($ this ->number , $ this ->brand );
45- $ this ->exsisting = new Verification ('44a5279b27dd4a638d614d265ad57a77 ' );
45+ $ this ->existing = new Verification ('44a5279b27dd4a638d614d265ad57a77 ' );
4646 }
4747
48- public function testExsistingAndNew ()
48+ public function testexistingAndNew ()
4949 {
5050 $ this ->assertTrue ($ this ->verification ->isDirty ());
51- $ this ->assertFalse ($ this ->exsisting ->isDirty ());
51+ $ this ->assertFalse ($ this ->existing ->isDirty ());
5252 }
5353
5454 public function testConstructDataAsObject ()
@@ -120,7 +120,7 @@ public function optionalValues()
120120 */
121121 public function testRequestId ()
122122 {
123- $ this ->assertEquals ('44a5279b27dd4a638d614d265ad57a77 ' , $ this ->exsisting ->getRequestId ());
123+ $ this ->assertEquals ('44a5279b27dd4a638d614d265ad57a77 ' , $ this ->existing ->getRequestId ());
124124
125125 $ this ->verification ->setResponse ($ this ->getResponse ('search ' ));
126126 $ this ->assertEquals ('44a5279b27dd4a638d614d265ad57a77 ' , $ this ->verification ->getRequestId ());
@@ -131,20 +131,20 @@ public function testRequestId()
131131 */
132132 public function testSearchParamsAsObject ()
133133 {
134- $ this ->exsisting ->setResponse ($ this ->getResponse ('search ' ));
135-
136- $ this ->assertEquals ('6cff3913 ' , $ this ->exsisting ->getAccountId ());
137- $ this ->assertEquals ('14845551212 ' , $ this ->exsisting ->getNumber ());
138- $ this ->assertEquals ('verify ' , $ this ->exsisting ->getSenderId ());
139- $ this ->assertEquals (new \DateTime ("2016-05-15 03:55:05 " ), $ this ->exsisting ->getSubmitted ());
140- $ this ->assertEquals (null , $ this ->exsisting ->getFinalized ());
141- $ this ->assertEquals (new \DateTime ("2016-05-15 03:55:05 " ), $ this ->exsisting ->getFirstEvent ());
142- $ this ->assertEquals (new \DateTime ("2016-05-15 03:57:12 " ), $ this ->exsisting ->getLastEvent ());
143- $ this ->assertEquals ('0.10000000 ' , $ this ->exsisting ->getPrice ());
144- $ this ->assertEquals ('EUR ' , $ this ->exsisting ->getCurrency ());
145- $ this ->assertEquals (Verification::FAILED , $ this ->exsisting ->getStatus ());
146-
147- $ checks = $ this ->exsisting ->getChecks ();
134+ $ this ->existing ->setResponse ($ this ->getResponse ('search ' ));
135+
136+ $ this ->assertEquals ('6cff3913 ' , $ this ->existing ->getAccountId ());
137+ $ this ->assertEquals ('14845551212 ' , $ this ->existing ->getNumber ());
138+ $ this ->assertEquals ('verify ' , $ this ->existing ->getSenderId ());
139+ $ this ->assertEquals (new \DateTime ("2016-05-15 03:55:05 " ), $ this ->existing ->getSubmitted ());
140+ $ this ->assertEquals (null , $ this ->existing ->getFinalized ());
141+ $ this ->assertEquals (new \DateTime ("2016-05-15 03:55:05 " ), $ this ->existing ->getFirstEvent ());
142+ $ this ->assertEquals (new \DateTime ("2016-05-15 03:57:12 " ), $ this ->existing ->getLastEvent ());
143+ $ this ->assertEquals ('0.10000000 ' , $ this ->existing ->getPrice ());
144+ $ this ->assertEquals ('EUR ' , $ this ->existing ->getCurrency ());
145+ $ this ->assertEquals (Verification::FAILED , $ this ->existing ->getStatus ());
146+
147+ $ checks = $ this ->existing ->getChecks ();
148148 $ this ->assertInternalType ('array ' , $ checks );
149149 $ this ->assertCount (3 , $ checks );
150150
@@ -175,11 +175,11 @@ public function testSearchParamsAsObject()
175175 */
176176 public function testResponseDataAsArray ($ type )
177177 {
178- $ this ->exsisting ->setResponse ($ this ->getResponse ($ type ));
179- $ json = $ this ->exsisting ->getResponseData ();
178+ $ this ->existing ->setResponse ($ this ->getResponse ($ type ));
179+ $ json = $ this ->existing ->getResponseData ();
180180
181181 foreach ($ json as $ key => $ value ){
182- $ this ->assertEquals ($ value , $ this ->exsisting [$ key ], "Could not access ` $ key` as a property. " );
182+ $ this ->assertEquals ($ value , $ this ->existing [$ key ], "Could not access ` $ key` as a property. " );
183183 }
184184 }
185185
@@ -198,80 +198,80 @@ public function testMethodsProxyClient($method, $proxy, $code = null, $ip = null
198198 {
199199 $ client = $ this ->prophesize ('Nexmo\Verify\Client ' );
200200 if (!is_null ($ ip )){
201- $ prediction = $ client ->$ proxy ($ this ->exsisting , $ code , $ ip );
201+ $ prediction = $ client ->$ proxy ($ this ->existing , $ code , $ ip );
202202 } elseif (!is_null ($ code )){
203- $ prediction = $ client ->$ proxy ($ this ->exsisting , $ code , Argument::cetera ());
203+ $ prediction = $ client ->$ proxy ($ this ->existing , $ code , Argument::cetera ());
204204 } else {
205- $ prediction = $ client ->$ proxy ($ this ->exsisting );
205+ $ prediction = $ client ->$ proxy ($ this ->existing );
206206 }
207207
208- $ prediction ->shouldBeCalled ()->willReturn ($ this ->exsisting );
208+ $ prediction ->shouldBeCalled ()->willReturn ($ this ->existing );
209209
210- $ this ->exsisting ->setClient ($ client ->reveal ());
210+ $ this ->existing ->setClient ($ client ->reveal ());
211211
212212 if (!is_null ($ ip )){
213- $ this ->exsisting ->$ method ($ code , $ ip );
213+ $ this ->existing ->$ method ($ code , $ ip );
214214 } elseif (!is_null ($ code )){
215- $ this ->exsisting ->$ method ($ code );
215+ $ this ->existing ->$ method ($ code );
216216 } else {
217- $ this ->exsisting ->$ method ();
217+ $ this ->existing ->$ method ();
218218 }
219219 }
220220
221221 public function testCheckReturnsBoolForInvalidCode ()
222222 {
223223 $ client = $ this ->prophesize ('Nexmo\Verify\Client ' );
224- $ client ->check ($ this ->exsisting , '1234 ' , Argument::cetera ())->willReturn ($ this ->exsisting );
225- $ client ->check ($ this ->exsisting , '4321 ' , Argument::cetera ())->willThrow (new \Nexmo \Client \Exception \Request ('dummy ' , '16 ' ));
224+ $ client ->check ($ this ->existing , '1234 ' , Argument::cetera ())->willReturn ($ this ->existing );
225+ $ client ->check ($ this ->existing , '4321 ' , Argument::cetera ())->willThrow (new \Nexmo \Client \Exception \Request ('dummy ' , '16 ' ));
226226
227- $ this ->exsisting ->setClient ($ client ->reveal ());
227+ $ this ->existing ->setClient ($ client ->reveal ());
228228
229- $ this ->assertFalse ($ this ->exsisting ->check ('4321 ' ));
230- $ this ->assertTrue ($ this ->exsisting ->check ('1234 ' ));
229+ $ this ->assertFalse ($ this ->existing ->check ('4321 ' ));
230+ $ this ->assertTrue ($ this ->existing ->check ('1234 ' ));
231231 }
232232
233233 public function testCheckReturnsBoolForTooManyAttempts ()
234234 {
235235 $ client = $ this ->prophesize ('Nexmo\Verify\Client ' );
236- $ client ->check ($ this ->exsisting , '1234 ' , Argument::cetera ())->willReturn ($ this ->exsisting );
237- $ client ->check ($ this ->exsisting , '4321 ' , Argument::cetera ())->willThrow (new \Nexmo \Client \Exception \Request ('dummy ' , '17 ' ));
236+ $ client ->check ($ this ->existing , '1234 ' , Argument::cetera ())->willReturn ($ this ->existing );
237+ $ client ->check ($ this ->existing , '4321 ' , Argument::cetera ())->willThrow (new \Nexmo \Client \Exception \Request ('dummy ' , '17 ' ));
238238
239- $ this ->exsisting ->setClient ($ client ->reveal ());
239+ $ this ->existing ->setClient ($ client ->reveal ());
240240
241- $ this ->assertFalse ($ this ->exsisting ->check ('4321 ' ));
242- $ this ->assertTrue ($ this ->exsisting ->check ('1234 ' ));
241+ $ this ->assertFalse ($ this ->existing ->check ('4321 ' ));
242+ $ this ->assertTrue ($ this ->existing ->check ('1234 ' ));
243243 }
244244
245245 public function testExceptionForCheckFail ()
246246 {
247247 $ client = $ this ->prophesize ('Nexmo\Verify\Client ' );
248- $ client ->check ($ this ->exsisting , '1234 ' , Argument::cetera ())->willReturn ($ this ->exsisting );
249- $ client ->check ($ this ->exsisting , '4321 ' , Argument::cetera ())->willThrow (new \Nexmo \Client \Exception \Request ('dummy ' , '6 ' ));
248+ $ client ->check ($ this ->existing , '1234 ' , Argument::cetera ())->willReturn ($ this ->existing );
249+ $ client ->check ($ this ->existing , '4321 ' , Argument::cetera ())->willThrow (new \Nexmo \Client \Exception \Request ('dummy ' , '6 ' ));
250250
251- $ this ->exsisting ->setClient ($ client ->reveal ());
251+ $ this ->existing ->setClient ($ client ->reveal ());
252252
253253 $ this ->expectException ('Nexmo\Client\Exception\Request ' );
254- $ this ->exsisting ->check ('4321 ' );
254+ $ this ->existing ->check ('4321 ' );
255255 }
256256
257257 /**
258258 * @dataProvider getSerializeResponses
259259 */
260260 public function testSerialize ($ response )
261261 {
262- $ this ->exsisting ->setResponse ($ response );
263- $ this ->exsisting ->getResponse ()->getBody ()->rewind ();
264- $ this ->exsisting ->getResponse ()->getBody ()->getContents ();
265- $ serialized = serialize ($ this ->exsisting );
262+ $ this ->existing ->setResponse ($ response );
263+ $ this ->existing ->getResponse ()->getBody ()->rewind ();
264+ $ this ->existing ->getResponse ()->getBody ()->getContents ();
265+ $ serialized = serialize ($ this ->existing );
266266 /* @var $unserialized Verification */
267267 $ unserialized = unserialize ($ serialized );
268268
269- $ this ->assertInstanceOf (get_class ($ this ->exsisting ), $ unserialized );
269+ $ this ->assertInstanceOf (get_class ($ this ->existing ), $ unserialized );
270270
271- $ this ->assertEquals ($ this ->exsisting ->getAccountId (), $ unserialized ->getAccountId ());
272- $ this ->assertEquals ($ this ->exsisting ->getStatus (), $ unserialized ->getStatus ());
271+ $ this ->assertEquals ($ this ->existing ->getAccountId (), $ unserialized ->getAccountId ());
272+ $ this ->assertEquals ($ this ->existing ->getStatus (), $ unserialized ->getStatus ());
273273
274- $ this ->assertEquals ($ this ->exsisting ->getResponseData (), $ unserialized ->getResponseData ());
274+ $ this ->assertEquals ($ this ->existing ->getResponseData (), $ unserialized ->getResponseData ());
275275 }
276276
277277 public function getSerializeResponses ()
@@ -290,11 +290,11 @@ public function testMissingClientException($method, $proxy, $code = null, $ip =
290290 $ this ->expectException ('RuntimeException ' );
291291
292292 if (!is_null ($ ip )){
293- $ this ->exsisting ->$ method ($ code , $ ip );
293+ $ this ->existing ->$ method ($ code , $ ip );
294294 } elseif (!is_null ($ code )){
295- $ this ->exsisting ->$ method ($ code );
295+ $ this ->existing ->$ method ($ code );
296296 } else {
297- $ this ->exsisting ->$ method ();
297+ $ this ->existing ->$ method ();
298298 }
299299 }
300300
0 commit comments