mirror of
https://github.com/friendica/friendica
synced 2024-12-22 19:20:17 +00:00
Create tests for App
This commit is contained in:
parent
af51441d88
commit
23e3af4a09
1 changed files with 29 additions and 0 deletions
29
tests/Unit/AppTest.php
Normal file
29
tests/Unit/AppTest.php
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
// Copyright (C) 2010-2024, the Friendica project
|
||||||
|
// SPDX-FileCopyrightText: 2010-2024 the Friendica project
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
|
||||||
|
declare(strict_types = 1);
|
||||||
|
|
||||||
|
namespace Friendica\Test\Unit;
|
||||||
|
|
||||||
|
use Dice\Dice;
|
||||||
|
use Friendica\App;
|
||||||
|
use PHPUnit\Framework\TestCase;
|
||||||
|
|
||||||
|
class AppTest extends TestCase
|
||||||
|
{
|
||||||
|
public function testFromDiceReturnsApp(): void
|
||||||
|
{
|
||||||
|
$dice = $this->createMock(Dice::class);
|
||||||
|
$dice->expects($this->exactly(13))->method('create')->willReturnCallback(function($classname) {
|
||||||
|
return $this->createMock($classname);
|
||||||
|
});
|
||||||
|
|
||||||
|
$app = App::fromDice($dice);
|
||||||
|
|
||||||
|
$this->assertInstanceOf(App::class, $app);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue