what does php --version
says ?
And are you running this with artisan tinker
or separately with boris or some other REPL ?
Also paste in the part of codes throwing error.
PHP 5.5.11-3+deb.sury.org~precise+1 (cli) (built: Apr 23 2014 12:28:12) Copyright (c) 1997-2014 The PHP Group Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies
Class A {
public doSearch($parameters){
$response = Twitter::getSearch($parameters);
}
in PHPUnit test:
TwitterFacade::shouldReceive('getSearch)');
$this->object->getSearch($parameters);
When I use:
Thujohn\Twitter\TwitterFacade::shouldReceive('getSearch)');
$tweets = $this->object->getSearch($parameters);
I got:
1) ATest::testGetSearch
ErrorException: Non-static method Thujohn\Twitter\TwitterFacade::getSearch() should not be called statically, assuming $this from incompatible context
Try removing the ")" from the end of 'getSearch)'.
thepsion5 said:
Try removing the ")" from the end of 'getSearch)'.
No, It was not a problem.
I changed code from Twitter::getSearch to $twitter = new Twitter(); $twitter->getSearch() and used mock provided within tests in package folder.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community