mirror of
https://git.friendi.ca/friendica/friendica.git
synced 2025-06-08 15:54:27 +02:00
Refactoring DBA-mocking tests
- Reducing DB-dependencies - Creating DB-cache mocks - Creating DB-lock mocks - Switching to mocked dependencies for Cache/Lock/App
This commit is contained in:
parent
f7e95f65b1
commit
433d6abe8c
21 changed files with 848 additions and 193 deletions
|
@ -99,6 +99,8 @@ class InstallerTest extends MockedTest
|
|||
*/
|
||||
public function testCheckKeys()
|
||||
{
|
||||
$this->mockL10nT();
|
||||
|
||||
$this->setFunctions(['openssl_pkey_new' => false]);
|
||||
$install = new Installer();
|
||||
$this->assertFalse($install->checkKeys());
|
||||
|
@ -209,6 +211,8 @@ class InstallerTest extends MockedTest
|
|||
*/
|
||||
public function testCheckLocalIni()
|
||||
{
|
||||
$this->mockL10nT();
|
||||
|
||||
$this->assertTrue($this->root->hasChild('config/local.config.php'));
|
||||
|
||||
$install = new Installer();
|
||||
|
@ -227,6 +231,8 @@ class InstallerTest extends MockedTest
|
|||
*/
|
||||
public function testCheckHtAccessFail()
|
||||
{
|
||||
$this->mockL10nT();
|
||||
|
||||
// Mocking the CURL Response
|
||||
$curlResult = \Mockery::mock('Friendica\Network\CurlResult');
|
||||
$curlResult
|
||||
|
@ -264,6 +270,8 @@ class InstallerTest extends MockedTest
|
|||
*/
|
||||
public function testCheckHtAccessWork()
|
||||
{
|
||||
$this->mockL10nT();
|
||||
|
||||
// Mocking the failed CURL Response
|
||||
$curlResultF = \Mockery::mock('Friendica\Network\CurlResult');
|
||||
$curlResultF
|
||||
|
@ -303,6 +311,8 @@ class InstallerTest extends MockedTest
|
|||
*/
|
||||
public function testImagick()
|
||||
{
|
||||
$this->mockL10nT();
|
||||
|
||||
$imageMock = \Mockery::mock('alias:Friendica\Object\Image');
|
||||
$imageMock
|
||||
->shouldReceive('supportedTypes')
|
||||
|
@ -328,6 +338,8 @@ class InstallerTest extends MockedTest
|
|||
*/
|
||||
public function testImagickNotFound()
|
||||
{
|
||||
$this->mockL10nT();
|
||||
|
||||
$imageMock = \Mockery::mock('alias:Friendica\Object\Image');
|
||||
$imageMock
|
||||
->shouldReceive('supportedTypes')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue