diff options
Diffstat (limited to 'tests/lib/AppFramework/AppTest.php')
-rw-r--r-- | tests/lib/AppFramework/AppTest.php | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/tests/lib/AppFramework/AppTest.php b/tests/lib/AppFramework/AppTest.php index 3c535a4bf7a..c43cd8e3c54 100644 --- a/tests/lib/AppFramework/AppTest.php +++ b/tests/lib/AppFramework/AppTest.php @@ -9,9 +9,10 @@ namespace Test\AppFramework; use OC\AppFramework\App; +use OC\AppFramework\DependencyInjection\DIContainer; use OC\AppFramework\Http\Dispatcher; use OCP\AppFramework\Controller; -use OCP\AppFramework\Http; +use OCP\AppFramework\Http\IOutput; use OCP\AppFramework\Http\Response; function rrmdir($directory) { @@ -43,10 +44,10 @@ class AppTest extends \Test\TestCase { protected function setUp(): void { parent::setUp(); - $this->container = new \OC\AppFramework\DependencyInjection\DIContainer('test', []); + $this->container = new DIContainer('test', []); $this->controller = $this->createMock(Controller::class); $this->dispatcher = $this->createMock(Dispatcher::class); - $this->io = $this->createMock(Http\IOutput::class); + $this->io = $this->createMock(IOutput::class); $this->headers = ['key' => 'value']; $this->output = 'hi'; @@ -62,11 +63,11 @@ class AppTest extends \Test\TestCase { $infoXmlPath = $this->appPath . '/appinfo/info.xml'; mkdir($this->appPath . '/appinfo', 0777, true); - $xml = '<?xml version="1.0" encoding="UTF-8"?>' . - '<info>' . - '<id>namespacetestapp</id>' . - '<namespace>NameSpaceTestApp</namespace>' . - '</info>'; + $xml = '<?xml version="1.0" encoding="UTF-8"?>' + . '<info>' + . '<id>namespacetestapp</id>' + . '<namespace>NameSpaceTestApp</namespace>' + . '</info>'; file_put_contents($infoXmlPath, $xml); } @@ -124,16 +125,14 @@ class AppTest extends \Test\TestCase { App::main($this->controllerName, $this->controllerMethod, $this->container, []); } - public function dataNoOutput() { + public static function dataNoOutput(): array { return [ ['HTTP/2.0 204 No content'], ['HTTP/2.0 304 Not modified'], ]; } - /** - * @dataProvider dataNoOutput - */ + #[\PHPUnit\Framework\Attributes\DataProvider('dataNoOutput')] public function testNoOutput(string $statusCode): void { $return = [$statusCode, [], [], $this->output, new Response()]; $this->dispatcher->expects($this->once()) |