mirror of
https://github.com/friendica/friendica
synced 2025-05-15 01:44:14 +02:00
Fix a lot of notices/warnings/deprecation notes in the test directory
This commit is contained in:
parent
efaec26b1d
commit
d55ecb9288
77 changed files with 428 additions and 558 deletions
|
@ -24,6 +24,7 @@ namespace Friendica\Test\src\Core\Config;
|
|||
use Friendica\Core\Config\Cache;
|
||||
use Friendica\Test\MockedTest;
|
||||
use ParagonIE\HiddenString\HiddenString;
|
||||
use stdClass;
|
||||
|
||||
class CacheTest extends MockedTest
|
||||
{
|
||||
|
@ -300,7 +301,7 @@ class CacheTest extends MockedTest
|
|||
{
|
||||
$configCache = new Cache([
|
||||
'database' => [
|
||||
'password' => new \stdClass(),
|
||||
'password' => new stdClass(),
|
||||
'username' => '',
|
||||
]
|
||||
]);
|
||||
|
|
|
@ -67,7 +67,7 @@ abstract class ConfigTest extends MockedTest
|
|||
/**
|
||||
* @return IConfig
|
||||
*/
|
||||
public abstract function getInstance();
|
||||
abstract public function getInstance();
|
||||
|
||||
public function dataTests()
|
||||
{
|
||||
|
@ -169,8 +169,11 @@ abstract class ConfigTest extends MockedTest
|
|||
|
||||
/**
|
||||
* Test the configuration load() method
|
||||
*
|
||||
* @param array $data
|
||||
* @param array $load
|
||||
*/
|
||||
public function testLoad(array $data, array $possibleCats, array $load)
|
||||
public function testLoad(array $data, array $load)
|
||||
{
|
||||
$this->testedConfig = $this->getInstance();
|
||||
self::assertInstanceOf(Cache::class, $this->testedConfig->getCache());
|
||||
|
@ -251,7 +254,7 @@ abstract class ConfigTest extends MockedTest
|
|||
/**
|
||||
* Test the configuration load() method with overwrite
|
||||
*/
|
||||
public function testCacheLoadDouble(array $data1, array $data2, array $expect)
|
||||
public function testCacheLoadDouble(array $data1, array $data2, array $expect = [])
|
||||
{
|
||||
$this->testedConfig = $this->getInstance();
|
||||
self::assertInstanceOf(Cache::class, $this->testedConfig->getCache());
|
||||
|
|
|
@ -45,8 +45,11 @@ class JitConfigTest extends ConfigTest
|
|||
|
||||
/**
|
||||
* @dataProvider dataConfigLoad
|
||||
*
|
||||
* @param array $data
|
||||
* @param array $load
|
||||
*/
|
||||
public function testLoad(array $data, array $possibleCats, array $load)
|
||||
public function testLoad(array $data, array $load)
|
||||
{
|
||||
$this->configModel->shouldReceive('isConnected')
|
||||
->andReturn(true)
|
||||
|
@ -64,13 +67,13 @@ class JitConfigTest extends ConfigTest
|
|||
->once();
|
||||
}
|
||||
|
||||
parent::testLoad($data, $possibleCats, $load);
|
||||
parent::testLoad($data, $load);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider dataDoubleLoad
|
||||
*/
|
||||
public function testCacheLoadDouble(array $data1, array $data2, array $expect)
|
||||
public function testCacheLoadDouble(array $data1, array $data2, array $expect = [])
|
||||
{
|
||||
$this->configModel->shouldReceive('isConnected')
|
||||
->andReturn(true)
|
||||
|
@ -96,7 +99,7 @@ class JitConfigTest extends ConfigTest
|
|||
->once();
|
||||
}
|
||||
|
||||
parent::testCacheLoadDouble($data1, $data2, $expect);
|
||||
parent::testCacheLoadDouble($data1, $data2);
|
||||
|
||||
// Assert the expected categories
|
||||
foreach ($data2 as $cat => $data) {
|
||||
|
|
|
@ -44,8 +44,11 @@ class PreloadConfigTest extends ConfigTest
|
|||
|
||||
/**
|
||||
* @dataProvider dataConfigLoad
|
||||
*
|
||||
* @param array $data
|
||||
* @param array $load
|
||||
*/
|
||||
public function testLoad(array $data, array $possibleCats, array $load)
|
||||
public function testLoad(array $data, array $load)
|
||||
{
|
||||
$this->configModel->shouldReceive('isConnected')
|
||||
->andReturn(true)
|
||||
|
@ -55,7 +58,7 @@ class PreloadConfigTest extends ConfigTest
|
|||
->andReturn($data)
|
||||
->once();
|
||||
|
||||
parent::testLoad($data, $possibleCats, $load);
|
||||
parent::testLoad($data, $load);
|
||||
|
||||
// Assert that every category is loaded everytime
|
||||
foreach ($data as $cat => $values) {
|
||||
|
@ -65,8 +68,11 @@ class PreloadConfigTest extends ConfigTest
|
|||
|
||||
/**
|
||||
* @dataProvider dataDoubleLoad
|
||||
*
|
||||
* @param array $data1
|
||||
* @param array $data2
|
||||
*/
|
||||
public function testCacheLoadDouble(array $data1, array $data2, array $expect)
|
||||
public function testCacheLoadDouble(array $data1, array $data2, array $expect = [])
|
||||
{
|
||||
$this->configModel->shouldReceive('isConnected')
|
||||
->andReturn(true)
|
||||
|
@ -76,7 +82,7 @@ class PreloadConfigTest extends ConfigTest
|
|||
->andReturn($data1)
|
||||
->once();
|
||||
|
||||
parent::testCacheLoadDouble($data1, $data2, $expect);
|
||||
parent::testCacheLoadDouble($data1, $data2);
|
||||
|
||||
// Assert that every category is loaded everytime and is NOT overwritten
|
||||
foreach ($data1 as $cat => $values) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue