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

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
---
A tests/api/BSApiCategoryTreeStoreTest.php
1 file changed, 90 insertions(+), 0 deletions(-)


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

diff --git a/tests/api/BSApiCategoryTreeStoreTest.php 
b/tests/api/BSApiCategoryTreeStoreTest.php
new file mode 100644
index 0000000..0abdde4
--- /dev/null
+++ b/tests/api/BSApiCategoryTreeStoreTest.php
@@ -0,0 +1,90 @@
+<?php
+
+/**
+ * @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/357983
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: master
Gerrit-Owner: ItSpiderman <[email protected]>

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

Reply via email to