@@ -541,15 +541,15 @@ public function testMissingArgumentsShouldResultInFaultResponse()
541
541
* @see ZF-1949
542
542
* @group ZF-1949
543
543
*/
544
- public function testMissingArgumentsWithDefaultsShouldNotResultInFaultResponse ()
544
+ public function testMissingAnonymousArgumentsWithDefaultsShouldNotResultInFaultResponse ()
545
545
{
546
546
$ server = new Zend_Rest_Server ();
547
547
$ server ->setClass ('Zend_Rest_Server_Test ' );
548
548
ob_start ();
549
549
$ server ->handle (array ('method ' => 'testFunc7 ' , 'arg1 ' => "Davey " ));
550
550
$ result = ob_get_clean ();
551
551
$ this ->assertContains ('<status>success</status> ' , $ result , var_export ($ result , 1 ));
552
- $ this ->assertContains ('<response>Hello today , How are you Davey </response> ' , $ result , var_export ($ result , 1 ));
552
+ $ this ->assertContains ('<response>Hello Davey , How are you today </response> ' , $ result , var_export ($ result , 1 ));
553
553
}
554
554
555
555
/**
@@ -577,6 +577,34 @@ public function testCallingNoMethodDoesNotThrowUnknownButSpecificErrorExceptionM
577
577
$ this ->assertContains ('<status>failed</status> ' , $ response );
578
578
$ this ->assertNotContains ('<message>An unknown error occured. Please try again.</message> ' , $ response );
579
579
}
580
+
581
+ /**
582
+ * @group GH-187
583
+ */
584
+ public function testMissingZeroBasedAnonymousArgumentsWithDefaultsShouldNotResultInFaultResponse ()
585
+ {
586
+ $ server = new Zend_Rest_Server ();
587
+ $ server ->setClass ('Zend_Rest_Server_Test ' );
588
+ ob_start ();
589
+ $ server ->handle (array ('method ' => 'testFunc7 ' , 'arg0 ' => "Davey " ));
590
+ $ result = ob_get_clean ();
591
+ $ this ->assertContains ('<status>success</status> ' , $ result , var_export ($ result , 1 ));
592
+ $ this ->assertContains ('<response>Hello Davey, How are you today</response> ' , $ result , var_export ($ result , 1 ));
593
+ }
594
+
595
+ /**
596
+ * @group GH-187
597
+ */
598
+ public function testMissingNamesArgumentsWithDefaultsShouldNotResultInFaultResponse ()
599
+ {
600
+ $ server = new Zend_Rest_Server ();
601
+ $ server ->setClass ('Zend_Rest_Server_Test ' );
602
+ ob_start ();
603
+ $ server ->handle (array ('method ' => 'testFunc7 ' , 'who ' => "Davey " ));
604
+ $ result = ob_get_clean ();
605
+ $ this ->assertContains ('<status>success</status> ' , $ result , var_export ($ result , 1 ));
606
+ $ this ->assertContains ('<response>Hello Davey, How are you today</response> ' , $ result , var_export ($ result , 1 ));
607
+ }
580
608
}
581
609
582
610
/* Test Functions */
0 commit comments