First Commit
This commit is contained in:
9
tests/bootstrap.php
Normal file
9
tests/bootstrap.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
require_once __DIR__ . '/../../../tests/bootstrap.php';
|
||||
require_once __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
\OC_App::loadApp(OCA\WebServer\AppInfo\Application::APP_ID);
|
||||
OC_Hook::clear();
|
0
tests/bootstrap.phpZone.Identifier
Normal file
0
tests/bootstrap.phpZone.Identifier
Normal file
12
tests/phpunit.xml
Normal file
12
tests/phpunit.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="bootstrap.php" timeoutForSmallTests="900" timeoutForMediumTests="900" timeoutForLargeTests="900" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.4/phpunit.xsd" cacheDirectory=".phpunit.cache">
|
||||
<testsuite name="Web Server Tests">
|
||||
<directory suffix="Test.php">.</directory>
|
||||
</testsuite>
|
||||
<source>
|
||||
<include>
|
||||
<directory suffix=".php">../appinfo</directory>
|
||||
<directory suffix=".php">../lib</directory>
|
||||
</include>
|
||||
</source>
|
||||
</phpunit>
|
0
tests/phpunit.xmlZone.Identifier
Normal file
0
tests/phpunit.xmlZone.Identifier
Normal file
19
tests/unit/Controller/ApiTest.php
Normal file
19
tests/unit/Controller/ApiTest.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Controller;
|
||||
|
||||
use OCA\WebServer\AppInfo\Application;
|
||||
use OCA\WebServer\Controller\ApiController;
|
||||
use OCP\IRequest;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class ApiTest extends TestCase {
|
||||
public function testIndex() {
|
||||
$request = $this->createMock(IRequest::class);
|
||||
$controller = new ApiController(Application::APP_ID, $request);
|
||||
|
||||
$this->assertEquals($controller->index()->getData()['message'], 'Hello world!');
|
||||
}
|
||||
}
|
0
tests/unit/Controller/ApiTest.phpZone.Identifier
Normal file
0
tests/unit/Controller/ApiTest.phpZone.Identifier
Normal file
Reference in New Issue
Block a user