Robert Vogel has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/358012 )
Change subject: API unittest: BSApiGroupStore ...................................................................... API unittest: BSApiGroupStore Change-Id: Id58d7c6a82b7a61a2b294c3b87791769c3ca84cb ERM: #6556 --- A tests/api/BSApiGroupStoreTest.php 1 file changed, 81 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/12/358012/1 diff --git a/tests/api/BSApiGroupStoreTest.php b/tests/api/BSApiGroupStoreTest.php new file mode 100644 index 0000000..08e58fe --- /dev/null +++ b/tests/api/BSApiGroupStoreTest.php @@ -0,0 +1,81 @@ +<?php + +/** + * @group medium + * @group api + * @group BlueSpice + * @group BlueSpiceFoundation + */ +class BSApiGroupStoreTest extends BSApiExtJSStoreTestBase { + + protected function getStoreSchema() { + return [ + 'group_name' => [ + 'type' => 'string' + ], + 'additional_group' => [ + 'type' => 'boolean' + ], + 'displayname' => [ + 'type' => 'string' + ] + ]; + } + + protected function createStoreFixtureData() { + global $wgGroupPermissions, $wgAdditionalGroups; + + $wgGroupPermissions['dummy']['read'] = true; + $wgGroupPermissions['fake']['read'] = true; + $wgAdditionalGroups['dummy'] = []; + $wgAdditionalGroups['fake'] = []; + + return 0; + } + + protected function getModuleName() { + return 'bs-group-store'; + } + + public function provideSingleFilterData() { + return [ + 'Filter by group_name' => [ 'string', 'eq', 'group_name', 'sysop', 1 ], + 'Filter by additional_group' => [ 'boolean', 'eq', 'additional_group', true, 2 ] + ]; + } + + public function provideMultipleFilterData() { + return [ + 'Filter by group_name and additional_group' => [ + [ + [ + 'type' => 'string', + 'comparison' => 'eq', + 'field' => 'group_name', + 'value' => 'fake' + ], + [ + 'type' => 'boolean', + 'comparison' => 'eq', + 'field' => 'additional_group', + 'value' => true + ] + ], + 1 + ] + ]; + } + + protected function skipAssertTotal() { + return true; + } + + public function provideKeyItemData() { + return array( + [ 'group_name', 'sysop' ], + [ 'group_name', 'bot' ], + [ 'group_name', 'dummy' ] + ); + } +} + -- To view, visit https://gerrit.wikimedia.org/r/358012 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id58d7c6a82b7a61a2b294c3b87791769c3ca84cb Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation Gerrit-Branch: REL1_27 Gerrit-Owner: Robert Vogel <vo...@hallowelt.biz> Gerrit-Reviewer: ItSpiderman <d.savulje...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits