jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/358337 )
Change subject: API unittest: BSApiCategoryStore
......................................................................
API unittest: BSApiCategoryStore
Patch Set 2: This test should work in REL1_27
Change-Id: I792c25ac3d326df62fc3eb829b105c411c4c0cfb
ERM: #6553
(cherry picked from commit e7697993754e9ae142139d9d2bb2333b773fc1f3)
---
A tests/api/BSApiCategoryStoreTest.php
1 file changed, 96 insertions(+), 0 deletions(-)
Approvals:
Mglaser: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/api/BSApiCategoryStoreTest.php
b/tests/api/BSApiCategoryStoreTest.php
new file mode 100644
index 0000000..baebda4
--- /dev/null
+++ b/tests/api/BSApiCategoryStoreTest.php
@@ -0,0 +1,96 @@
+<?php
+
+/**
+ * @group medium
+ * @group api
+ * @group BlueSpice
+ * @group BlueSpiceFoundation
+ */
+class BSApiCategoryStoreTest extends BSApiExtJSStoreTestBase {
+ protected $iFixtureTotal = 2;
+
+ protected function getStoreSchema() {
+ return [
+ 'cat_id' => [
+ 'type' => 'integer'
+ ],
+ 'cat_title' => [
+ 'type' => 'string'
+ ],
+ 'text' => [
+ 'type' => 'string'
+ ],
+ 'cat_pages' => [
+ 'type' => 'integer'
+ ],
+ 'cat_subcats' => [
+ 'type' => 'integer'
+ ],
+ 'cat_files' => [
+ 'type' => 'integer'
+ ],
+ 'prefixed_text' => [
+ 'type' => 'sting'
+ ]
+ ];
+ }
+
+ 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-store';
+ }
+
+ public function provideSingleFilterData() {
+ return [
+ 'Filter by cat_title' => [ 'string', 'ct', 'cat_title',
'test', 2 ]
+ ];
+ }
+
+ public function provideMultipleFilterData() {
+ return [
+ 'Filter by cat_pages and cat_title' => [
+ [
+ [
+ 'type' => 'numeric',
+ 'comparison' => 'eq',
+ 'field' => 'cat_pages',
+ 'value' => 3
+ ],
+ [
+ 'type' => 'string',
+ 'comparison' => 'ct',
+ 'field' => 'cat_title',
+ 'value' => 'test'
+ ]
+ ],
+ 1
+ ]
+ ];
+ }
+}
+
--
To view, visit https://gerrit.wikimedia.org/r/358337
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I792c25ac3d326df62fc3eb829b105c411c4c0cfb
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation
Gerrit-Branch: REL1_27
Gerrit-Owner: Mglaser <[email protected]>
Gerrit-Reviewer: ItSpiderman <[email protected]>
Gerrit-Reviewer: Ljonka <[email protected]>
Gerrit-Reviewer: Mglaser <[email protected]>
Gerrit-Reviewer: Pwirth <[email protected]>
Gerrit-Reviewer: Robert Vogel <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits