]> git.mxchange.org Git - friendica.git/commitdiff
Possibly fixed test
authorMichael <heluecht@pirati.ca>
Sat, 9 Jun 2018 20:39:40 +0000 (20:39 +0000)
committerMichael <heluecht@pirati.ca>
Sat, 9 Jun 2018 20:39:40 +0000 (20:39 +0000)
include/api.php
tests/ApiTest.php

index dba20d4c1be3381d442299f7780c0250c61405de..00c2173c38b1b8f4c4297047928e1b8396447f42 100644 (file)
@@ -1920,7 +1920,7 @@ function api_statuses_show($type)
        $statuses = Item::select(api_user(), [], $condition, $params);
 
        /// @TODO How about copying this to above methods which don't check $r ?
-       if (!DBM::is_result($items)) {
+       if (!DBM::is_result($statuses)) {
                throw new BadRequestException("There is no status with this id.");
        }
 
@@ -2000,7 +2000,7 @@ function api_conversation_show($type)
        $params = ['order' => ['id' => true], 'limit' => [$start, $count]];
        $statuses = Item::select(api_user(), [], $condition, $params);
 
-       if (!DBM::is_result($items)) {
+       if (!DBM::is_result($statuses)) {
                throw new BadRequestException("There is no status with id $id.");
        }
 
index f0e27b4af1d25f9d18b993360a70a3282934c9d1..c21f651d5fa051dc83e01660e380f1a4157a12ea 100644 (file)
@@ -1871,7 +1871,7 @@ class ApiTest extends DatabaseTest
                $this->app->argv[1] = '1.1';
                $this->app->argv[3] = 'create';
                $this->app->argc = 10;
-               $_REQUEST['id'] = 1;
+               $_REQUEST['id'] = 3;
                $result = api_favorites_create_destroy('json');
                $this->assertStatus($result['status']);
        }
@@ -1885,7 +1885,7 @@ class ApiTest extends DatabaseTest
                $this->app->argv[1] = '1.1';
                $this->app->argv[3] = 'create';
                $this->app->argc = 10;
-               $_REQUEST['id'] = 1;
+               $_REQUEST['id'] = 3;
                $result = api_favorites_create_destroy('rss');
                $this->assertXml($result, 'status');
        }
@@ -1899,7 +1899,7 @@ class ApiTest extends DatabaseTest
                $this->app->argv[1] = '1.1';
                $this->app->argv[3] = 'destroy';
                $this->app->argc = 10;
-               $_REQUEST['id'] = 1;
+               $_REQUEST['id'] = 3;
                $result = api_favorites_create_destroy('json');
                $this->assertStatus($result['status']);
        }