mirror of
https://github.com/friendica/friendica
synced 2025-04-24 00:30:11 +00:00
Fix tests
- Fix InstallerTest case - Fix native function mocking - Add returntype for Unit-Tests - Fixing ExtendedPDO test troubles - Fix wrong class inheritance path for DatabaseTestTrait.php - Fix SyslogLogger Server Exception for PHP8 - Add user/contact to database.fixture.php - Avoid invalid rollbacks for test setup in PHP8
This commit is contained in:
parent
8cab5edea9
commit
02e6dff6a0
53 changed files with 171 additions and 69 deletions
|
@ -45,7 +45,7 @@ class InstallerTest extends MockedTest
|
|||
*/
|
||||
private $dice;
|
||||
|
||||
protected function setUp()
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -64,6 +64,15 @@ class InstallerTest extends MockedTest
|
|||
DI::init($this->dice);
|
||||
}
|
||||
|
||||
public static function tearDownAfterClass(): void
|
||||
{
|
||||
// Reset mocking
|
||||
global $phpMock;
|
||||
$phpMock = [];
|
||||
|
||||
parent::tearDownAfterClass();
|
||||
}
|
||||
|
||||
private function mockL10nT(string $text, $times = null)
|
||||
{
|
||||
$this->l10nMock->shouldReceive('t')->with($text)->andReturn($text)->times($times);
|
||||
|
@ -467,7 +476,7 @@ class InstallerTest extends MockedTest
|
|||
*/
|
||||
public function testSetUpCache()
|
||||
{
|
||||
$this->l10nMock->shouldReceive('t')->andReturnUsing(function ($args) { return $args; })->times(5);
|
||||
$this->l10nMock->shouldReceive('t')->andReturnUsing(function ($args) { return $args; });
|
||||
|
||||
$install = new Installer();
|
||||
$configCache = Mockery::mock(Cache::class);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue