- fix: add constructor

- test
This commit is contained in:
stefan.tollkuehn committed 2026-10-22 17:33:58 +02:00
1 parent 5febe2c27a
commit 2703773fe1
2 files changed
+27

No files matched your search

+4
View File
@@ -9,4 +9,8 @@ use OCP\AppFramework\App;
class Application extends App
{
public const APP_ID = 'atocal';
public function __construct(array $urlParams = []) {
parent::__construct(self::APP_ID, $urlParams);
}
}
+23
View File
@@ -0,0 +1,23 @@
<?php
declare(strict_types=1);
namespace OCA\AToCal\Tests\Unit\AppInfo;
use OCA\AToCal\AppInfo\Application;
use PHPUnit\Framework\TestCase;
use ReflectionMethod;
class ApplicationTest extends TestCase
{
public function testSupportsZeroArgumentConstruction(): void {
/*
* The server container instantiates the app class without arguments,
* see ServerContainer::getAppContainer(). The app class must pass the
* app id to App::__construct() itself.
*/
$constructor = new ReflectionMethod(Application::class, '__construct');
$this->assertSame(0, $constructor->getNumberOfRequiredParameters());
}
}