Fix a lot of notices/warnings/deprecation notes in the test directory

This commit is contained in:
Philipp 2020-10-18 20:31:57 +02:00
parent efaec26b1d
commit d55ecb9288
No known key found for this signature in database
GPG key ID: 9A28B7D4FF5667BD
77 changed files with 428 additions and 558 deletions

View file

@ -29,6 +29,7 @@ use Friendica\LegacyModule;
use Friendica\Module\HTTPException\PageNotFound;
use Friendica\Module\WellKnown\HostMeta;
use Friendica\Test\DatabaseTest;
use Mockery;
class ModuleTest extends DatabaseTest
{
@ -170,13 +171,13 @@ class ModuleTest extends DatabaseTest
*/
public function testModuleClass($assert, string $name, string $command, bool $privAdd)
{
$config = \Mockery::mock(IConfig::class);
$config = Mockery::mock(IConfig::class);
$config->shouldReceive('get')->with('config', 'private_addons', false)->andReturn($privAdd)->atMost()->once();
$l10n = \Mockery::mock(L10n::class);
$l10n = Mockery::mock(L10n::class);
$l10n->shouldReceive('t')->andReturnUsing(function ($args) { return $args; });
$cache = \Mockery::mock(ICache::class);
$cache = Mockery::mock(ICache::class);
$cache->shouldReceive('get')->with('routerDispatchData')->andReturn('')->atMost()->once();
$cache->shouldReceive('get')->with('lastRoutesFileModifiedTime')->andReturn('')->atMost()->once();
$cache->shouldReceive('set')->withAnyArgs()->andReturn(false)->atMost()->twice();