]> git.mxchange.org Git - friendica.git/blobdiff - tests/Util/DBAMockTrait.php
Merge pull request #10294 from annando/http-input-data
[friendica.git] / tests / Util / DBAMockTrait.php
index ab5bc6059edec3765c9fa132610ec7f692f6c0fc..8967348daee54229f62ff07e93186097d2c9ab09 100644 (file)
@@ -1,4 +1,23 @@
 <?php
+/**
+ * @copyright Copyright (C) 2010-2021, the Friendica project
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
 
 namespace Friendica\Test\Util;
 
@@ -62,11 +81,11 @@ trait DBAMockTrait
        /**
         * Mocking DBA::fetchFirst()
         *
-        * @param string $arg The argument of fetchFirst
-        * @param bool $return True, if the DB is connected, otherwise false
-        * @param null|int $times How often the method will get used
+        * @param string   $arg    The argument of fetchFirst
+        * @param bool     $return True, if the DB is connected, otherwise false
+        * @param null|int $times  How often the method will get used
         */
-       public function mockFetchFirst($arg, $return = true, $times = null)
+       public function mockFetchFirst(string $arg, bool $return = true, int $times = null)
        {
                $this->checkMock();
 
@@ -120,13 +139,13 @@ trait DBAMockTrait
        /**
         * Mocking DBA::select()
         *
-        * @param string $tableName The name of the table
-        * @param array $select The Select Array (Default is [])
-        * @param array $where The Where Array (Default is [])
-        * @param object $return The array to return (Default is [])
-        * @param null|int $times How often the method will get used
+        * @param string   $tableName The name of the table
+        * @param array    $select    The Select Array (Default is [])
+        * @param array    $where     The Where Array (Default is [])
+        * @param object   $return    The array to return (Default is [])
+        * @param null|int $times     How often the method will get used
         */
-       public function mockSelect($tableName, $select = [], $where = [], $return = null, $times = null)
+       public function mockSelect(string $tableName, array $select = [], array $where = [], $return = null, int $times = null)
        {
                $this->checkMock();
 
@@ -140,12 +159,12 @@ trait DBAMockTrait
        /**
         * Mocking DBA::delete()
         *
-        * @param string $tableName The name of the table
-        * @param array $where The Where Array (Default is [])
-        * @param bool $return The array to return (Default is true)
-        * @param null|int $times How often the method will get used
+        * @param string   $tableName The name of the table
+        * @param array    $where     The Where Array (Default is [])
+        * @param bool     $return    The array to return (Default is true)
+        * @param null|int $times     How often the method will get used
         */
-       public function mockDBADelete($tableName, $where = [], $return = true, $times = null)
+       public function mockDBADelete(string $tableName, array $where = [], bool $return = true, int $times = null)
        {
                $this->checkMock();
 
@@ -159,14 +178,14 @@ trait DBAMockTrait
        /**
         * Mocking DBA::update()
         *
-        * @param string $expTableName The name of the table
-        * @param array $expFields The Fields Array
-        * @param array $expCondition The Condition Array
-        * @param array $expOld_fields The Old Fieldnames (Default is [])
-        * @param bool $return true if the update was successful
-        * @param null|int $times How often the method will get used
+        * @param string   $expTableName  The name of the table
+        * @param array    $expFields     The Fields Array
+        * @param array    $expCondition  The Condition Array
+        * @param array    $expOld_fields The Old Fieldnames (Default is [])
+        * @param bool     $return        true if the update was successful
+        * @param null|int $times         How often the method will get used
         */
-       public function mockDBAUpdate($expTableName, $expFields, $expCondition, $expOld_fields = [], $return = true, $times = null)
+       public function mockDBAUpdate(string $expTableName, array $expFields, array $expCondition, array $expOld_fields = [], bool $return = true, int $times = null)
        {
                $this->checkMock();
 
@@ -188,13 +207,13 @@ trait DBAMockTrait
        /**
         * Mocking DBA::insert()
         *
-        * @param string $expTableName    The name of the table
-        * @param array  $expParam        The Parameters Array
-        * @param bool   $expOnDuplUpdate Update on a duplicated entry
-        * @param bool   $return          True if the insert was successful
-        * @param null|int $times How often the method will get used
+        * @param string   $expTableName    The name of the table
+        * @param array    $expParam        The Parameters Array
+        * @param bool     $expOnDuplUpdate Update on a duplicated entry
+        * @param bool     $return          True if the insert was successful
+        * @param null|int $times           How often the method will get used
         */
-       public function mockDBAInsert($expTableName, $expParam, $expOnDuplUpdate = false, $return = true, $times = null)
+       public function mockDBAInsert(string $expTableName, array $expParam, bool $expOnDuplUpdate = false, bool $return = true, int $times = null)
        {
                $this->checkMock();
 
@@ -215,13 +234,13 @@ trait DBAMockTrait
        /**
         * Mocking DBA::selectFirst()
         *
-        * @param string $expTableName The name of the table
-        * @param array $expSelect The Select Array (Default is [])
-        * @param array $expWhere The Where Array (Default is [])
-        * @param array $return The array to return (Default is [])
-        * @param null|int $times How often the method will get used
+        * @param string   $expTableName The name of the table
+        * @param array    $expSelect    The Select Array (Default is [])
+        * @param array    $expWhere     The Where Array (Default is [])
+        * @param array    $return       The array to return (Default is [])
+        * @param null|int $times        How often the method will get used
         */
-       public function mockSelectFirst($expTableName, $expSelect = [], $expWhere = [], $return = [], $times = null)
+       public function mockSelectFirst(string $expTableName, array $expSelect = [], array $expWhere = [], array $return = [], int $times = null)
        {
                $this->checkMock();
 
@@ -302,11 +321,11 @@ trait DBAMockTrait
        /**
         * Mocking DBA::lock()
         *
-        * @param string $table The table to lock
-        * @param bool $return True, if the lock is set successful
-        * @param null|int $times How often the method will get used
+        * @param string   $table  The table to lock
+        * @param bool     $return True, if the lock is set successful
+        * @param null|int $times  How often the method will get used
         */
-       public function mockDbaLock($table, $return = true, $times = null)
+       public function mockDbaLock(string $table, bool $return = true, int $times = null)
        {
                $this->checkMock();