]> git.mxchange.org Git - friendica.git/commitdiff
Move API\Photo testcases
authorPhilipp <admin@philipp.info>
Fri, 12 Nov 2021 20:12:00 +0000 (21:12 +0100)
committerPhilipp <admin@philipp.info>
Fri, 12 Nov 2021 20:12:00 +0000 (21:12 +0100)
tests/legacy/ApiTest.php
tests/src/Module/Api/Friendica/Photo/DeleteTest.php
tests/src/Module/Api/Friendica/Photo/UpdateTest.php [deleted file]
tests/src/Module/Api/Friendica/Photoalbum/DeleteTest.php [new file with mode: 0644]
tests/src/Module/Api/Friendica/Photoalbum/UpdateTest.php [new file with mode: 0644]

index 645c078a466a35b1113f3949725789b346243e82..1a88e6403f7cea2076be26be66e3665e921de728 100644 (file)
@@ -3254,51 +3254,6 @@ class ApiTest extends FixtureTest
                $this->markTestIncomplete();
        }
 
-       /**
-        * Test the api_fr_photo_delete() function.
-        *
-        * @return void
-        */
-       public function testApiFrPhotoDelete()
-       {
-               // $this->expectException(\Friendica\Network\HTTPException\BadRequestException::class);
-               // api_fr_photo_delete('json');
-       }
-
-       /**
-        * Test the api_fr_photo_delete() function without an authenticated user.
-        *
-        * @return void
-        */
-       public function testApiFrPhotoDeleteWithoutAuthenticatedUser()
-       {
-               // $this->expectException(\Friendica\Network\HTTPException\ForbiddenException::class);
-               // $_SESSION['authenticated'] = false;
-               // api_fr_photo_delete('json');
-       }
-
-       /**
-        * Test the api_fr_photo_delete() function with a photo ID.
-        *
-        * @return void
-        */
-       public function testApiFrPhotoDeleteWithPhotoId()
-       {
-               // $this->expectException(\Friendica\Network\HTTPException\BadRequestException::class);
-               // $_REQUEST['photo_id'] = 1;
-               // api_fr_photo_delete('json');
-       }
-
-       /**
-        * Test the api_fr_photo_delete() function with a correct photo ID.
-        *
-        * @return void
-        */
-       public function testApiFrPhotoDeleteWithCorrectPhotoId()
-       {
-               $this->markTestIncomplete('We need to create a dataset for this.');
-       }
-
        /**
         * Test the api_fr_photo_detail() function.
         *
index 69e9dbd31470592a7529d19c353315ab2430c03f..a47c87e98ad14bbb70c950141656bf583a8d492d 100644 (file)
@@ -2,7 +2,7 @@
 
 namespace Friendica\Test\src\Module\Api\Friendica\Photo;
 
-use Friendica\Module\Api\Friendica\Photoalbum\Delete;
+use Friendica\Module\Api\Friendica\Photo\Delete;
 use Friendica\Network\HTTPException\BadRequestException;
 use Friendica\Test\src\Module\Api\ApiTest;
 
@@ -14,13 +14,18 @@ class DeleteTest extends ApiTest
                Delete::rawContent();
        }
 
+       public function testWithoutAuthenticatedUser()
+       {
+               self::markTestIncomplete('Needs BasicAuth as dynamic method for overriding first');
+       }
+
        public function testWrong()
        {
                self::expectException(BadRequestException::class);
-               Delete::rawContent(['album' => 'album_name']);
+               Delete::rawContent(['photo_id' => 1]);
        }
 
-       public function testValid()
+       public function testWithCorrectPhotoId()
        {
                self::markTestIncomplete('We need to add a dataset for this.');
        }
diff --git a/tests/src/Module/Api/Friendica/Photo/UpdateTest.php b/tests/src/Module/Api/Friendica/Photo/UpdateTest.php
deleted file mode 100644 (file)
index f233998..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-<?php
-
-namespace Friendica\Test\src\Module\Api\Friendica\Photo;
-
-use Friendica\Module\Api\Friendica\Photoalbum\Update;
-use Friendica\Network\HTTPException\BadRequestException;
-use Friendica\Test\src\Module\Api\ApiTest;
-
-class UpdateTest extends ApiTest
-{
-       public function testEmpty()
-       {
-               self::expectException(BadRequestException::class);
-               Update::rawContent();
-       }
-
-       public function testTooFewArgs()
-       {
-               self::expectException(BadRequestException::class);
-               Update::rawContent(['album' => 'album_name']);
-       }
-
-       public function testWrongUpdate()
-       {
-               self::expectException(BadRequestException::class);
-               Update::rawContent(['album' => 'album_name', 'album_new' => 'album_name']);
-       }
-
-       public function testUpdateWithoutAuthenticatedUser()
-       {
-               self::markTestIncomplete('Needs BasicAuth as dynamic method for overriding first');
-       }
-
-       public function testValid()
-       {
-               self::markTestIncomplete('We need to add a dataset for this.');
-       }
-}
diff --git a/tests/src/Module/Api/Friendica/Photoalbum/DeleteTest.php b/tests/src/Module/Api/Friendica/Photoalbum/DeleteTest.php
new file mode 100644 (file)
index 0000000..ed9cd11
--- /dev/null
@@ -0,0 +1,27 @@
+<?php
+
+namespace Friendica\Test\src\Module\Api\Friendica\Photoalbum;
+
+use Friendica\Module\Api\Friendica\Photoalbum\Delete;
+use Friendica\Network\HTTPException\BadRequestException;
+use Friendica\Test\src\Module\Api\ApiTest;
+
+class DeleteTest extends ApiTest
+{
+       public function testEmpty()
+       {
+               self::expectException(BadRequestException::class);
+               Delete::rawContent();
+       }
+
+       public function testWrong()
+       {
+               self::expectException(BadRequestException::class);
+               Delete::rawContent(['album' => 'album_name']);
+       }
+
+       public function testValid()
+       {
+               self::markTestIncomplete('We need to add a dataset for this.');
+       }
+}
diff --git a/tests/src/Module/Api/Friendica/Photoalbum/UpdateTest.php b/tests/src/Module/Api/Friendica/Photoalbum/UpdateTest.php
new file mode 100644 (file)
index 0000000..93c1cdc
--- /dev/null
@@ -0,0 +1,38 @@
+<?php
+
+namespace Friendica\Test\src\Module\Api\Friendica\Photoalbum;
+
+use Friendica\Module\Api\Friendica\Photoalbum\Update;
+use Friendica\Network\HTTPException\BadRequestException;
+use Friendica\Test\src\Module\Api\ApiTest;
+
+class UpdateTest extends ApiTest
+{
+       public function testEmpty()
+       {
+               self::expectException(BadRequestException::class);
+               Update::rawContent();
+       }
+
+       public function testTooFewArgs()
+       {
+               self::expectException(BadRequestException::class);
+               Update::rawContent(['album' => 'album_name']);
+       }
+
+       public function testWrongUpdate()
+       {
+               self::expectException(BadRequestException::class);
+               Update::rawContent(['album' => 'album_name', 'album_new' => 'album_name']);
+       }
+
+       public function testWithoutAuthenticatedUser()
+       {
+               self::markTestIncomplete('Needs BasicAuth as dynamic method for overriding first');
+       }
+
+       public function testValid()
+       {
+               self::markTestIncomplete('We need to add a dataset for this.');
+       }
+}