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

Change subject: API unittest: BSApiWikiPageStore
......................................................................

API unittest: BSApiWikiPageStore

Change-Id: If774f57c39184bec254ea877c43189d8d2c9060d
ERM: #6591
---
A tests/api/BSApiWikiPageStoreTest.php
1 file changed, 79 insertions(+), 0 deletions(-)


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

diff --git a/tests/api/BSApiWikiPageStoreTest.php 
b/tests/api/BSApiWikiPageStoreTest.php
new file mode 100644
index 0000000..771d215
--- /dev/null
+++ b/tests/api/BSApiWikiPageStoreTest.php
@@ -0,0 +1,79 @@
+<?php
+
+/**
+ * @group medium
+ * @group api
+ * @group BlueSpice
+ * @group BlueSpiceFoundation
+ */
+class BSApiWikiPageStoreTest extends BSApiExtJSStoreTestBase {
+
+       protected function skipAssertTotal() {
+               return true;
+       }
+
+       protected function getStoreSchema() {
+               return [
+                       'page_id' => [
+                               'type' => 'integer'
+                       ],
+                       'page_namespace' => [
+                               'type' => 'integer'
+                       ],
+                       'page_title' => [
+                               'type' => 'string'
+                       ]
+               ];
+       }
+
+       protected function createStoreFixtureData() {
+               $oPageFixtures = new BSPageFixturesProvider();
+               $aFixtures = $oPageFixtures->getFixtureData();
+               foreach( $aFixtures as $aFixture ) {
+                       $this->insertPage( $aFixture[0], $aFixture[1] );
+               }
+
+               return 0;
+       }
+
+       protected function getModuleName() {
+               return 'bs-wikipage-store';
+       }
+
+       public function provideSingleFilterData() {
+               return [
+                       'Filter by page_title' => [ 'string', 'ct', 
'page_title', 'Test', 2 ]
+               ];
+       }
+
+       public function provideMultipleFilterData() {
+               return [
+                       'Filter by page_namespace and page_title' => [
+                               [
+                                       [
+                                               'type' => 'numeric',
+                                               'comparison' => 'eq',
+                                               'field' => 'page_namespace',
+                                               'value' => 12
+                                       ],
+                                       [
+                                               'type' => 'string',
+                                               'comparison' => 'eq',
+                                               'field' => 'page_title',
+                                               'value' => 'Test'
+                                       ]
+                               ],
+                               1
+                       ]
+               ];
+       }
+
+       public function provideKeyItemData() {
+               return array(
+                       [ 'page_title', 'Зарегистрируйтесь_сейчас' ],
+                       [ 'page_title', 'テスト' ],
+                       [ 'page_namespace', 10 ]
+               );
+       }
+}
+

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If774f57c39184bec254ea877c43189d8d2c9060d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation
Gerrit-Branch: master
Gerrit-Owner: ItSpiderman <d.savulje...@gmail.com>

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

Reply via email to