]> git.mxchange.org Git - friendica.git/commitdiff
Create tests for App
authorArt4 <art4@wlabs.de>
Thu, 19 Dec 2024 20:37:56 +0000 (20:37 +0000)
committerArt4 <art4@wlabs.de>
Thu, 19 Dec 2024 20:37:56 +0000 (20:37 +0000)
tests/Unit/AppTest.php [new file with mode: 0644]

diff --git a/tests/Unit/AppTest.php b/tests/Unit/AppTest.php
new file mode 100644 (file)
index 0000000..c7b9599
--- /dev/null
@@ -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);
+       }
+}