Hello,
I am just getting into unit testing. I am testing out my application. It
uses Zend_Oauth and Zend_Service_Twitter.
I have a model which requires me to feed it an instance of
Zend_Oauth_Token_Access. The problem is, how do I create a dummy for that
intance?
I have the following below:
----------------------------------
$oauth_token_stub = $this->getMock('Zend_Oauth_Token',
array('getAccessToken'),array(),'',FALSE);
$oauth_token_stub->expects($this->once())->method('getAccessToken');
----------------------------------
The error I get from PHPUnit is:
----------------------------------
testuserTimeline(Model_TwitterTest)
Argument 1 passed to Twitter_Model_Twitter::__construct() must be an
instance of Zend_Oauth_Token_Access, null given, called in
/htdocs/twitter/tests/application/models/TwitterTest.php on line 63 and
defined
/htdocs/twitter/application/models/Twitter.php:15
/htdocs/twitter/tests/application/models/TwitterTest.php:63
NOTE: that Argument 1 is is $oauth_token_stub I am trying to pass...
Any ideas?
Thanks,
Wenbert
-----
http://blog.ekini.net
--
View this message in context:
http://www.nabble.com/Creating-a-dummy-object-of-Zend_Oauth_Token_Access-for-Unit-Testing-tp25127669p25127669.html
Sent from the Zend Framework mailing list archive at Nabble.com.