Explorar el Código

Increased mock object detail in a test - leave nothing to chance!

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@19800 44c647ce-9c0f-0410-b52a-842ac1e357ba
padraic hace 16 años
padre
commit
71ad8f72cb
Se han modificado 1 ficheros con 14 adiciones y 1 borrados
  1. 14 1
      tests/Zend/Feed/Pubsubhubbub/Subscriber/CallbackTest.php

+ 14 - 1
tests/Zend/Feed/Pubsubhubbub/Subscriber/CallbackTest.php

@@ -251,10 +251,23 @@ class Zend_Feed_Pubsubhubbub_Subscriber_CallbackTest extends PHPUnit_Framework_T
         $rowdata = new stdClass;
         $rowdata->id = 'verifytokenkey';
         $rowdata->verify_token = hash('sha256', 'cba');
-        $rowdata->created_time = time();
+        $t = time();
+        $rowdata->created_time = $t;
         $this->_rowset->expects($this->any())
             ->method('current')
             ->will($this->returnValue($rowdata));
+            
+        $this->_tableGateway->expects($this->once())
+            ->method('update')
+            ->with(
+                $this->equalTo(array('id'=>'verifytokenkey','verify_token'=>hash('sha256', 'cba'),'created_time'=>$t,'verified'=>'1')),
+                $this->equalTo('id = \'verifytokenkey\'')
+            );
+        $this->_adapter->expects($this->once())
+            ->method('quoteInto')
+            ->with($this->equalTo('id = ?'), $this->equalTo('verifytokenkey'))
+            ->will($this->returnValue('id = \'verifytokenkey\'')); 
+            
         $this->_callback->handle($this->_get);
         $this->assertTrue($this->_callback->getHttpResponse()->getHttpResponseCode() == 200);
     }