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

@ -24,7 +24,7 @@ class ProcessTest extends DatabaseTest
$this->setUpVfsDir();
$this->logger = new NullLogger();
$logger = new NullLogger();
$profiler = \Mockery::mock(Profiler::class);
$profiler->shouldReceive('saveTimestamp')->withAnyArgs()->andReturn(true);
@ -34,7 +34,7 @@ class ProcessTest extends DatabaseTest
$loader = new ConfigFileLoader($this->root->url());
$configCache = $configFactory->createCache($loader);
$this->dba = new StaticDatabase($configCache, $profiler, $this->logger);
$this->dba = new StaticDatabase($configCache, $profiler, $logger);
}
public function testInsertDelete()

View file

@ -25,12 +25,12 @@ use Friendica\Core\Config\IConfig;
use Friendica\Core\L10n;
use Friendica\Model\Storage\Filesystem;
use Friendica\Model\Storage\IStorage;
use Friendica\Model\Storage\StorageException;
use Friendica\Test\Util\VFSTrait;
use Friendica\Util\Profiler;
use Mockery\MockInterface;
use org\bovigo\vfs\vfsStream;
use Psr\Log\NullLogger;
use function GuzzleHttp\Psr7\uri_for;
class FilesystemStorageTest extends StorageTest
{
@ -77,12 +77,11 @@ class FilesystemStorageTest extends StorageTest
/**
* Test the exception in case of missing directorsy permissions
*
* @expectedException \Friendica\Model\Storage\StorageException
* @expectedExceptionMessageRegExp /Filesystem storage failed to create \".*\". Check you write permissions./
*/
public function testMissingDirPermissions()
{
$this->expectException(StorageException::class);
$this->expectExceptionMessageRegExp("/Filesystem storage failed to create \".*\". Check you write permissions./");
$this->root->getChild('storage')->chmod(000);
$instance = $this->getInstance();
@ -92,12 +91,13 @@ class FilesystemStorageTest extends StorageTest
/**
* Test the exception in case of missing file permissions
*
* @expectedException \Friendica\Model\Storage\StorageException
* @expectedExceptionMessageRegExp /Filesystem storage failed to save data to \".*\". Check your write permissions/
*/
public function testMissingFilePermissions()
{
$this->markTestIncomplete("Cannot catch file_put_content() error due vfsStream failure");
static::markTestIncomplete("Cannot catch file_put_content() error due vfsStream failure");
$this->expectException(StorageException::class);
$this->expectExceptionMessageRegExp("/Filesystem storage failed to save data to \".*\". Check your write permissions/");
vfsStream::create(['storage' => ['f0' => ['c0' => ['k0i0' => '']]]], $this->root);

View file

@ -48,6 +48,8 @@ class CookieTest extends MockedTest
protected function tearDown()
{
StaticCookie::clearStatic();
parent::tearDown();
}
/**