]> git.mxchange.org Git - friendica.git/commitdiff
Replace DI::app() with DI::appHelper() in Module\Api\Friendica namespace tests
authorArt4 <art4@wlabs.de>
Wed, 18 Dec 2024 20:55:39 +0000 (20:55 +0000)
committerArt4 <art4@wlabs.de>
Wed, 18 Dec 2024 20:55:39 +0000 (20:55 +0000)
tests/src/Module/Api/Friendica/DirectMessages/SearchTest.php
tests/src/Module/Api/Friendica/NotificationTest.php
tests/src/Module/Api/Friendica/Photo/DeleteTest.php
tests/src/Module/Api/Friendica/Photoalbum/DeleteTest.php
tests/src/Module/Api/Friendica/Photoalbum/UpdateTest.php

index 6b26b50ec3a349a159eeaa00ad7d1527d7584952..27ea3e327d467bc960032bbf28a3fac13c18172c 100644 (file)
@@ -19,7 +19,7 @@ class SearchTest extends ApiTestCase
        {
                $directMessage = new DirectMessage(new NullLogger(), DI::dba(), DI::twitterUser());
 
-               $response = (new Search($directMessage, DI::dba(), DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
+               $response = (new Search($directMessage, DI::dba(), DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
                        ->run($this->httpExceptionMock);
 
                $json = $this->toJson($response);
@@ -37,7 +37,7 @@ class SearchTest extends ApiTestCase
 
                $directMessage = new DirectMessage(new NullLogger(), DI::dba(), DI::twitterUser());
 
-               $response = (new Search($directMessage, DI::dba(), DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
+               $response = (new Search($directMessage, DI::dba(), DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
                        ->run($this->httpExceptionMock, [
                                'searchstring' => 'item_body'
                        ]);
@@ -58,7 +58,7 @@ class SearchTest extends ApiTestCase
        {
                $directMessage = new DirectMessage(new NullLogger(), DI::dba(), DI::twitterUser());
 
-               $response = (new Search($directMessage, DI::dba(), DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
+               $response = (new Search($directMessage, DI::dba(), DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
                        ->run($this->httpExceptionMock, [
                                'searchstring' => 'test'
                        ]);
index e05041acb6667a59edb5af4fdf8b874f4956a55e..c31b43d55dab40381e12bec9791263fdad2a0972 100644 (file)
@@ -52,7 +52,7 @@ class NotificationTest extends ApiTestCase
 </notes>
 XML;
 
-               $response = (new Notification(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'xml']))
+               $response = (new Notification(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'xml']))
                        ->run($this->httpExceptionMock);
 
                self::assertXmlStringEqualsXmlString($assertXml, (string)$response->getBody());
@@ -64,7 +64,7 @@ XML;
 
        public function testWithJsonResult()
        {
-               $response = (new Notification(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json']))
+               $response = (new Notification(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json']))
                        ->run($this->httpExceptionMock);
 
                $json = $this->toJson($response);
index 1ba144011cc5e92ae049488e2560969f35ca49d7..19d440cd7016404afb46fe9b5a70f76246fcffa3 100644 (file)
@@ -25,7 +25,7 @@ class DeleteTest extends ApiTestCase
        public function testEmpty()
        {
                $this->expectException(BadRequestException::class);
-               (new Delete(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))->run($this->httpExceptionMock);
+               (new Delete(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))->run($this->httpExceptionMock);
        }
 
        public function testWithoutAuthenticatedUser()
@@ -36,14 +36,14 @@ class DeleteTest extends ApiTestCase
        public function testWrong()
        {
                $this->expectException(BadRequestException::class);
-               (new Delete(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))->run($this->httpExceptionMock, ['photo_id' => 1]);
+               (new Delete(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))->run($this->httpExceptionMock, ['photo_id' => 1]);
        }
 
        public function testValidWithPost()
        {
                $this->loadFixture(__DIR__ . '/../../../../../datasets/photo/photo.fixture.php', DI::dba());
 
-               $response = (new Delete(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
+               $response = (new Delete(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
                        ->run($this->httpExceptionMock, [
                                'photo_id' => '709057080661a283a6aa598501504178'
                        ]);
@@ -58,7 +58,7 @@ class DeleteTest extends ApiTestCase
        {
                $this->loadFixture(__DIR__ . '/../../../../../datasets/photo/photo.fixture.php', DI::dba());
 
-               $response = (new Delete(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
+               $response = (new Delete(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
                        ->run($this->httpExceptionMock, [
                                'photo_id' => '709057080661a283a6aa598501504178'
                        ]);
index fae9c2cf4d86a2bd0df7fed251558cd1c8c7e44d..727ba63a2b54f1ded2792ec2bb335ce2d21d3e33 100644 (file)
@@ -25,7 +25,7 @@ class DeleteTest extends ApiTestCase
        public function testEmpty()
        {
                $this->expectException(BadRequestException::class);
-               (new Delete(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
+               (new Delete(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
                        ->run($this->httpExceptionMock);
 
        }
@@ -33,7 +33,7 @@ class DeleteTest extends ApiTestCase
        public function testWrong()
        {
                $this->expectException(BadRequestException::class);
-               (new Delete(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
+               (new Delete(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
                        ->run($this->httpExceptionMock, [
                                'album' => 'album_name'
                        ]);
@@ -43,7 +43,7 @@ class DeleteTest extends ApiTestCase
        {
                $this->loadFixture(__DIR__ . '/../../../../../datasets/photo/photo.fixture.php', DI::dba());
 
-               $response = (new Delete(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
+               $response = (new Delete(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
                        ->run($this->httpExceptionMock, [
                                'album' => 'test_album']
                        );
index 0b5f71f2b16f18cb05d4df499eb8d5ee019700a2..6ac54c392b530d01fa9fb6531773320979cedd9e 100644 (file)
@@ -25,14 +25,14 @@ class UpdateTest extends ApiTestCase
        public function testEmpty()
        {
                $this->expectException(BadRequestException::class);
-               (new Update(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
+               (new Update(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
                        ->run($this->httpExceptionMock);
        }
 
        public function testTooFewArgs()
        {
                $this->expectException(BadRequestException::class);
-               (new Update(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
+               (new Update(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
                        ->run($this->httpExceptionMock, [
                                'album' => 'album_name'
                        ]);
@@ -41,7 +41,7 @@ class UpdateTest extends ApiTestCase
        public function testWrongUpdate()
        {
                $this->expectException(BadRequestException::class);
-               (new Update(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
+               (new Update(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
                        ->run($this->httpExceptionMock, [
                                'album'     => 'album_name',
                                'album_new' => 'album_name'
@@ -57,7 +57,7 @@ class UpdateTest extends ApiTestCase
        {
                $this->loadFixture(__DIR__ . '/../../../../../datasets/photo/photo.fixture.php', DI::dba());
 
-               $response = (new Update(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
+               $response = (new Update(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
                        ->run($this->httpExceptionMock, [
                                'album'     => 'test_album',
                                'album_new' => 'test_album_2'