From ff8b578cde6816280b72c3586242bf3bf30f0f0d Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 17 Jan 2021 22:20:46 +0000 Subject: [PATCH] Fix the test data / unused function removed --- src/Model/Item.php | 25 ---------- tests/datasets/api.fixture.php | 86 +++++++++++++++++----------------- 2 files changed, 44 insertions(+), 67 deletions(-) diff --git a/src/Model/Item.php b/src/Model/Item.php index 83f71004e0..c8677d8425 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -370,31 +370,6 @@ class Item return $retval; } - /** - * Retrieve a single record from the item table and returns it in an associative array - * - * @param array $fields - * @param array $condition - * @param array $params - * @return bool|array - * @throws \Exception - * @see DBA::select - */ - public static function selectFirst(array $fields = [], array $condition = [], $params = []) - { - $params['limit'] = 1; - - $result = self::select($fields, $condition, $params); - - if (is_bool($result)) { - return $result; - } else { - $row = self::fetch($result); - DBA::close($result); - return $row; - } - } - /** * Select rows from the item table and returns them as an array * diff --git a/tests/datasets/api.fixture.php b/tests/datasets/api.fixture.php index 95c427d7c9..7a0ad6cd44 100644 --- a/tests/datasets/api.fixture.php +++ b/tests/datasets/api.fixture.php @@ -180,47 +180,49 @@ return [ ], ], 'item-content' => [ - 'id' => 1, - 'uri-id' => 1, - 'uri-plink-hash' => '1', - 'body' => 'Parent status', - 'plink' => 'http://localhost/display/1', - ], - 'item-content' => [ - 'id' => 2, - 'uri-id' => 2, - 'uri-plink-hash' => '2', - 'body' => 'Reply', - 'plink' => 'http://localhost/display/2', - ], - 'item-content' => [ - 'id' => 3, - 'uri-id' => 3, - 'uri-plink-hash' => '3', - 'body' => 'Other user status', - 'plink' => 'http://localhost/display/3', - ], - 'item-content' => [ - 'id' => 4, - 'uri-id' => 4, - 'uri-plink-hash' => '4', - 'body' => 'Friend user reply', - 'plink' => 'http://localhost/display/4', - ], - 'item-content' => [ - 'id' => 5, - 'uri-id' => 5, - 'uri-plink-hash' => '5', - 'body' => '[share]Shared status[/share]', - 'plink' => 'http://localhost/display/5', - ], - 'item-content' => [ - 'id' => 6, - 'uri-id' => 6, - 'uri-plink-hash' => '6', - 'body' => 'Friend user status', - 'plink' => 'http://localhost/display/6', - ], + [ + 'id' => 1, + 'uri-id' => 1, + 'uri-plink-hash' => '1', + 'body' => 'Parent status', + 'plink' => 'http://localhost/display/1', + ], + [ + 'id' => 2, + 'uri-id' => 2, + 'uri-plink-hash' => '2', + 'body' => 'Reply', + 'plink' => 'http://localhost/display/2', + ], + [ + 'id' => 3, + 'uri-id' => 3, + 'uri-plink-hash' => '3', + 'body' => 'Other user status', + 'plink' => 'http://localhost/display/3', + ], + [ + 'id' => 4, + 'uri-id' => 4, + 'uri-plink-hash' => '4', + 'body' => 'Friend user reply', + 'plink' => 'http://localhost/display/4', + ], + [ + 'id' => 5, + 'uri-id' => 5, + 'uri-plink-hash' => '5', + 'body' => '[share]Shared status[/share]', + 'plink' => 'http://localhost/display/5', + ], + [ + 'id' => 6, + 'uri-id' => 6, + 'uri-plink-hash' => '6', + 'body' => 'Friend user status', + 'plink' => 'http://localhost/display/6', + ], + ], 'item' => [ [ 'id' => 1, @@ -267,8 +269,8 @@ return [ 'starred' => 0, 'origin' => 1, 'guid' => '2', + ], [ - 'id' => 3, 'uri-id' => 3, 'visible' => 1,