瀏覽代碼

[TESTS]: correction of Zend_Json_ServerTest not to fully introspect PHPUnit classes

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@24321 44c647ce-9c0f-0410-b52a-842ac1e357ba
mikaelkael 14 年之前
父節點
當前提交
f2c2a4e6ef
共有 1 個文件被更改,包括 10 次插入3 次删除
  1. 10 3
      tests/Zend/Json/ServerTest.php

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

@@ -83,11 +83,18 @@ class Zend_Json_ServerTest extends PHPUnit_Framework_TestCase
         $this->assertTrue($methods->hasMethod('strtolower'));
     }
 
-    public function testShouldBeAbleToBindCallbackToServer()
+    public function testShouldBeAbleToBindCallback1ToServer()
     {
-        $this->server->addFunction(array($this, 'setUp'));
+        $this->server->addFunction(array('Zend_Json_ServerTest_Foo', 'bar'));
         $methods = $this->server->getFunctions();
-        $this->assertTrue($methods->hasMethod('setUp'));
+        $this->assertTrue($methods->hasMethod('bar'));
+    }
+
+    public function testShouldBeAbleToBindCallback2ToServer()
+    {
+        $this->server->addFunction(array(new Zend_Json_ServerTest_Foo, 'bar'));
+        $methods = $this->server->getFunctions();
+        $this->assertTrue($methods->hasMethod('bar'));
     }
 
     public function testShouldBeAbleToBindClassToServer()