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

Change subject: API unittest: BSApiCategoryTreeStore
......................................................................

API unittest: BSApiCategoryTreeStore

ERM: #6554

Since this store requires param 'node' to be passed, i had to implement
https://gerrit.wikimedia.org/r/#/c/357982/
and its needed for this test to work

Change-Id: If30e9458730924024db8dfe2a1ed96f40ab5c88d
(cherry picked from commit 312c8df8d1f30638ee6bfd8c5cc47cdc84189b49)
---
A tests/api/BSApiCategoryTreeStoreTest.php
1 file changed, 93 insertions(+), 0 deletions(-)


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

diff --git a/tests/api/BSApiCategoryTreeStoreTest.php 
b/tests/api/BSApiCategoryTreeStoreTest.php
new file mode 100644
index 0000000..37c5ef0
--- /dev/null
+++ b/tests/api/BSApiCategoryTreeStoreTest.php
@@ -0,0 +1,93 @@
+<?php
+
+/**
+ * The base fixture has changed since MW 1.27. Therefore the test is marked
+ * broken until BlueSpice updates its compatibility.
+ * @group Broken
+ * @group medium
+ * @group api
+ * @group BlueSpice
+ * @group BlueSpiceFoundation
+ */
+class BSApiCategoryTreeStoreTest extends BSApiExtJSStoreTestBase {
+       protected $iFixtureTotal = 2;
+
+       protected function getStoreSchema() {
+               return [
+                       'text' => [
+                               'type' => 'string'
+                       ],
+                       'leaf' => [
+                               'type' => 'boolean'
+                       ],
+                       'id' => [
+                               'type' => 'string'
+                       ]
+               ];
+       }
+
+       protected function createStoreFixtureData() {
+               $oDbw = wfGetDB( DB_MASTER );
+               $oDbw->insert( 'category', array(
+                       'cat_title' => "Dummy test",
+                       'cat_pages' => 3,
+                       'cat_files' => 1
+               ) );
+
+               $oDbw->insert( 'category', array(
+                       'cat_title' => "Dummy test 2",
+                       'cat_pages' => 2,
+                       'cat_files' => 3
+               ) );
+
+               $oDbw->insert( 'categorylinks', array(
+                       'cl_to' => "Dummy test"
+               ) );
+
+               $oDbw->insert( 'page', array(
+                       'page_title' => "Dummy test 2",
+                       'page_namespace' => NS_CATEGORY
+               ) );
+
+               return 2;
+       }
+
+       protected function getModuleName() {
+               return 'bs-category-treestore';
+       }
+
+       public function provideSingleFilterData() {
+               return [
+                       'Filter by id' => [ 'string', 'ct', 'id', 'src/', 2 ]
+               ];
+       }
+
+       public function provideMultipleFilterData() {
+               return [
+                       'Filter by leaf and text' => [
+                               [
+                                       [
+                                               'type' => 'boolean',
+                                               'comparison' => 'eq',
+                                               'field' => 'leaf',
+                                               'value' => true
+                                       ],
+                                       [
+                                               'type' => 'string',
+                                               'comparison' => 'eq',
+                                               'field' => 'text',
+                                               'value' => 'Dummy test 2'
+                                       ]
+                               ],
+                               1
+                       ]
+               ];
+       }
+
+       protected function getAdditionalParams() {
+               return [
+                       'node' => 'src'
+               ];
+       }
+}
+

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If30e9458730924024db8dfe2a1ed96f40ab5c88d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation
Gerrit-Branch: REL1_27
Gerrit-Owner: Mglaser <[email protected]>
Gerrit-Reviewer: ItSpiderman <[email protected]>

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

Reply via email to