ItSpiderman has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/357982 )

Change subject: Add function for retrieving custom params
......................................................................

Add function for retrieving custom params

Added a function that classes inheriting this base class can override and
pass any number and type of params to be passes when executing API
request.

Problematic is that there is already logic implemented that lets you pass
'query' param by overriding sQuery var. This is now unnecessary as 'query'
can also be passed over the new function, but for backwards compatibility
cannot be removed

Change-Id: I94e779512bf9d1a35e7cce61a129a0695b6a1178
---
M tests/BSApiExtJSStoreTestBase.php
1 file changed, 11 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation 
refs/changes/82/357982/1

diff --git a/tests/BSApiExtJSStoreTestBase.php 
b/tests/BSApiExtJSStoreTestBase.php
index 20672ed..ca0495c 100644
--- a/tests/BSApiExtJSStoreTestBase.php
+++ b/tests/BSApiExtJSStoreTestBase.php
@@ -80,6 +80,7 @@
                if( $this->sQuery ) {
                        $aParams['query'] = $this->sQuery;
                }
+               $aParams = array_merge( $aParams, $this->getAdditionalParams() 
);
                $results = $this->doApiRequest( $aParams );
                $response = $results[0];
 
@@ -138,6 +139,8 @@
                        $aParams['query'] = $this->sQuery;
                }
 
+               $aParams = array_merge( $aParams, $this->getAdditionalParams() 
);
+
                $results = $this->doApiRequest( $aParams );
 
                $response = $results[0];
@@ -167,6 +170,8 @@
                        $aParams['query'] = $this->sQuery;
                }
 
+               $aParams = array_merge( $aParams, $this->getAdditionalParams() 
);
+
                $results = $this->doApiRequest( $aParams );
 
                $response = $results[0];
@@ -189,6 +194,12 @@
                        $aParams['query'] = $this->sQuery;
                }
 
+               $aParams = array_merge( $aParams, $this->getAdditionalParams() 
);
+
                return $aParams;
        }
+
+       protected function getAdditionalParams() {
+               return [];
+       }
 }
\ No newline at end of file

-- 
To view, visit https://gerrit.wikimedia.org/r/357982
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I94e779512bf9d1a35e7cce61a129a0695b6a1178
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation
Gerrit-Branch: master
Gerrit-Owner: ItSpiderman <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to