2
0
Quellcode durchsuchen

Ensure that the static method that we're testing in Zend_Json_ServerTest is actually declared as a static

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@24709 44c647ce-9c0f-0410-b52a-842ac1e357ba
rob vor 13 Jahren
Ursprung
Commit
b42a640271
2 geänderte Dateien mit 17 neuen und 3 gelöschten Zeilen
  1. 1 0
      tests/Zend/Http/Client/StaticTest.php
  2. 16 3
      tests/Zend/Json/ServerTest.php

+ 1 - 0
tests/Zend/Http/Client/StaticTest.php

@@ -650,6 +650,7 @@ class Zend_Http_Client_StaticTest extends PHPUnit_Framework_TestCase
 		} catch (Zend_Http_Client_Exception $e) {
 			$this->fail('Unexpected exception was thrown');
 		}
+        echo "THERE";
 		// we can safely return until we can verify link is still active
 		// @todo verify link is still active
 		return;

+ 16 - 3
tests/Zend/Json/ServerTest.php

@@ -85,9 +85,9 @@ class Zend_Json_ServerTest extends PHPUnit_Framework_TestCase
 
     public function testShouldBeAbleToBindCallback1ToServer()
     {
-        $this->server->addFunction(array('Zend_Json_ServerTest_Foo', 'bar'));
+        $this->server->addFunction(array('Zend_Json_ServerTest_Foo', 'staticBar'));
         $methods = $this->server->getFunctions();
-        $this->assertTrue($methods->hasMethod('bar'));
+        $this->assertTrue($methods->hasMethod('staticBar'));
     }
 
     public function testShouldBeAbleToBindCallback2ToServer()
@@ -462,12 +462,25 @@ class Zend_Json_ServerTest_Foo
      * @param  mixed $three
      * @return array
      */
-    public function bar($one, $two = 'two', $three = null)
+    static public function staticBar($one, $two = 'two', $three = null)
     {
         return array($one, $two, $three);
     }
 
     /**
+     * Bar
+     *
+     * @param  bool $one
+     * @param  string $two
+     * @param  mixed $three
+     * @return array
+     */
+    public function bar($one, $two = 'two', $three = null)
+    {
+        return array($one, $two, $three);
+    }    
+
+    /**
      * Baz
      *
      * @return void