jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/357975 )

Change subject: API unittest: BSApiAdminUserStore and BSApiUserStore
......................................................................


API unittest: BSApiAdminUserStore and BSApiUserStore

Change-Id: I540d7042bcd4cf5191890ca2d20824fd2cdbfe5f
ERM: #6551, #6552
---
A tests/api/BSApiAdminUserStoreTest.php
A tests/api/BSApiUserStoreTest.php
2 files changed, 163 insertions(+), 0 deletions(-)

Approvals:
  Mglaser: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/tests/api/BSApiAdminUserStoreTest.php 
b/tests/api/BSApiAdminUserStoreTest.php
new file mode 100644
index 0000000..5eae774
--- /dev/null
+++ b/tests/api/BSApiAdminUserStoreTest.php
@@ -0,0 +1,83 @@
+<?php
+
+/**
+ * @group medium
+ * @group api
+ * @group BlueSpice
+ * @group BlueSpiceFoundation
+ */
+class BSApiAdminUserStoreTest extends BSApiExtJSStoreTestBase {
+       protected $iFixtureTotal = 3;
+
+       protected function getStoreSchema() {
+               return [
+                       'user_id' => [
+                               'type' => 'integer'
+                       ],
+                       'user_name' => [
+                               'type' => 'string'
+                       ],
+                       'user_real_name' => [
+                               'type' => 'string'
+                       ],
+                       'user_registration' => [
+                               'type' => 'string'
+                       ],
+                       'user_editcount' => [
+                               'type' => 'integer'
+                       ],
+                       'groups' => [
+                               'type' => 'array'
+                       ],
+                       'enabled' => [
+                               'type' => 'boolean'
+                       ],
+                       'page_link' => [
+                               'type' => 'string'
+                       ],
+                       'page_prefixed_text' => [
+                               'type' => 'string'
+                       ],
+                       'user_email' => [
+                               'type' => 'string'
+                       ]
+               ];
+       }
+
+       protected function createStoreFixtureData() {
+               return 3;
+       }
+
+       protected function getModuleName() {
+               return 'bs-adminuser-store';
+       }
+
+       public function provideSingleFilterData() {
+               return [
+                       'Filter by user_name' => [ 'string', 'ct', 'user_name', 
'Sysop', 2 ]
+               ];
+       }
+
+       public function provideMultipleFilterData() {
+               return [
+                       'Filter by user_email and user_name' => [
+                               [
+                                       [
+                                               'type' => 'string',
+                                               'comparison' => 'ct',
+                                               'field' => 'user_email',
+                                               'value' => 'example.com'
+                                       ],
+                                       [
+                                               'type' => 'string',
+                                               'comparison' => 'ct',
+                                               'field' => 'user_name',
+                                               'value' => 'Sysop'
+                                       ]
+                               ],
+                               1
+                       ]
+               ];
+       }
+}
+
diff --git a/tests/api/BSApiUserStoreTest.php b/tests/api/BSApiUserStoreTest.php
new file mode 100644
index 0000000..2fb0dbd
--- /dev/null
+++ b/tests/api/BSApiUserStoreTest.php
@@ -0,0 +1,80 @@
+<?php
+
+/**
+ * @group medium
+ * @group api
+ * @group BlueSpice
+ * @group BlueSpiceFoundation
+ */
+class BSApiUserStoreTest extends BSApiExtJSStoreTestBase {
+       protected $iFixtureTotal = 3;
+
+       protected function getStoreSchema() {
+               return [
+                       'user_id' => [
+                               'type' => 'integer'
+                       ],
+                       'user_name' => [
+                               'type' => 'string'
+                       ],
+                       'user_real_name' => [
+                               'type' => 'string'
+                       ],
+                       'user_registration' => [
+                               'type' => 'string'
+                       ],
+                       'user_editcount' => [
+                               'type' => 'integer'
+                       ],
+                       'groups' => [
+                               'type' => 'array'
+                       ],
+                       'enabled' => [
+                               'type' => 'boolean'
+                       ],
+                       'page_link' => [
+                               'type' => 'string'
+                       ],
+                       'page_prefixed_text' => [
+                               'type' => 'string'
+                       ]
+               ];
+       }
+
+       protected function createStoreFixtureData() {
+               return 3;
+       }
+
+       protected function getModuleName() {
+               return 'bs-user-store';
+       }
+
+       public function provideSingleFilterData() {
+               return [
+                       'Filter by user_name' => [ 'string', 'ct', 'user_name', 
'Sysop', 2 ]
+               ];
+       }
+
+       public function provideMultipleFilterData() {
+               return [
+                       'Filter by display_name and user_name' => [
+                               [
+                                       [
+                                               'type' => 'string',
+                                               'comparison' => 'eq',
+                                               'field' => 'display_name',
+                                               'value' => 'UTSysop'
+                                       ],
+                                       [
+                                               'type' => 'string',
+                                               'comparison' => 'ct',
+                                               'field' => 'user_name',
+                                               'value' => 'Sysop'
+                                       ]
+                               ],
+                               1
+                       ]
+               ];
+       }
+}
+

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I540d7042bcd4cf5191890ca2d20824fd2cdbfe5f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation
Gerrit-Branch: REL1_27
Gerrit-Owner: Mglaser <gla...@hallowelt.biz>
Gerrit-Reviewer: ItSpiderman <d.savulje...@gmail.com>
Gerrit-Reviewer: Mglaser <gla...@hallowelt.biz>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to