- fix: add constructor
- test
This commit is contained in:
1 parent
5febe2c27a
commit
2703773fe1
2 files changed
+27
No files matched your search
@@ -9,4 +9,8 @@ use OCP\AppFramework\App;
|
|||||||
class Application extends App
|
class Application extends App
|
||||||
{
|
{
|
||||||
public const APP_ID = 'atocal';
|
public const APP_ID = 'atocal';
|
||||||
|
|
||||||
|
public function __construct(array $urlParams = []) {
|
||||||
|
parent::__construct(self::APP_ID, $urlParams);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -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());
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in new issue
Block a user