Refactoring Core class structures ...

This commit is contained in:
Philipp 2021-10-26 21:44:29 +02:00
parent 57b4c008cb
commit b216317477
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
130 changed files with 1625 additions and 1397 deletions

View file

@ -2,7 +2,7 @@
namespace Friendica\Test\src\Util;
use Friendica\App\BaseURL;
use Friendica\Core\Config\IConfig;
use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Test\MockedTest;
class BaseURLTest extends MockedTest
@ -173,7 +173,7 @@ class BaseURLTest extends MockedTest
*/
public function testCheck($server, $input, $assert)
{
$configMock = \Mockery::mock(IConfig::class);
$configMock = \Mockery::mock(IManageConfigValues::class);
$configMock->shouldReceive('get')->with('config', 'hostname')->andReturn($input['hostname']);
$configMock->shouldReceive('get')->with('system', 'urlpath')->andReturn($input['urlPath']);
$configMock->shouldReceive('get')->with('system', 'ssl_policy')->andReturn($input['sslPolicy']);
@ -295,7 +295,7 @@ class BaseURLTest extends MockedTest
*/
public function testSave($input, $save, $url)
{
$configMock = \Mockery::mock(IConfig::class);
$configMock = \Mockery::mock(IManageConfigValues::class);
$configMock->shouldReceive('get')->with('config', 'hostname')->andReturn($input['hostname']);
$configMock->shouldReceive('get')->with('system', 'urlpath')->andReturn($input['urlPath']);
$configMock->shouldReceive('get')->with('system', 'ssl_policy')->andReturn($input['sslPolicy']);
@ -333,7 +333,7 @@ class BaseURLTest extends MockedTest
*/
public function testSaveByUrl($input, $save, $url)
{
$configMock = \Mockery::mock(IConfig::class);
$configMock = \Mockery::mock(IManageConfigValues::class);
$configMock->shouldReceive('get')->with('config', 'hostname')->andReturn($input['hostname']);
$configMock->shouldReceive('get')->with('system', 'urlpath')->andReturn($input['urlPath']);
$configMock->shouldReceive('get')->with('system', 'ssl_policy')->andReturn($input['sslPolicy']);
@ -409,7 +409,7 @@ class BaseURLTest extends MockedTest
*/
public function testGetURL($sslPolicy, $ssl, $url, $assert)
{
$configMock = \Mockery::mock(IConfig::class);
$configMock = \Mockery::mock(IManageConfigValues::class);
$configMock->shouldReceive('get')->with('config', 'hostname')->andReturn('friendica.local');
$configMock->shouldReceive('get')->with('system', 'urlpath')->andReturn('new/test');
$configMock->shouldReceive('get')->with('system', 'ssl_policy')->andReturn($sslPolicy);
@ -467,7 +467,7 @@ class BaseURLTest extends MockedTest
*/
public function testCheckRedirectHTTPS($server, $forceSSL, $sslPolicy, $url, $redirect)
{
$configMock = \Mockery::mock(IConfig::class);
$configMock = \Mockery::mock(IManageConfigValues::class);
$configMock->shouldReceive('get')->with('config', 'hostname')->andReturn('friendica.local');
$configMock->shouldReceive('get')->with('system', 'urlpath')->andReturn('new/test');
$configMock->shouldReceive('get')->with('system', 'ssl_policy')->andReturn($sslPolicy);
@ -503,7 +503,7 @@ class BaseURLTest extends MockedTest
*/
public function testWrongSave($fail)
{
$configMock = \Mockery::mock(IConfig::class);
$configMock = \Mockery::mock(IManageConfigValues::class);
$configMock->shouldReceive('get')->with('config', 'hostname')->andReturn('friendica.local');
$configMock->shouldReceive('get')->with('system', 'urlpath')->andReturn('new/test');
$configMock->shouldReceive('get')->with('system', 'ssl_policy')->andReturn(BaseURL::DEFAULT_SSL_SCHEME);