Mglaser has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/390397 )

Change subject: fixed php unit tests
......................................................................


fixed php unit tests

Change-Id: I71308c8de890bb589099d8d059c714fbf9e68e99
---
M tests/phpunit/BSApiPageTemplatesStoreTest.php
M tests/phpunit/utility/BSPageTemplateFixtures.php
2 files changed, 14 insertions(+), 9 deletions(-)

Approvals:
  Mglaser: Verified; Looks good to me, approved



diff --git a/tests/phpunit/BSApiPageTemplatesStoreTest.php 
b/tests/phpunit/BSApiPageTemplatesStoreTest.php
index 6640426..40524c5 100644
--- a/tests/phpunit/BSApiPageTemplatesStoreTest.php
+++ b/tests/phpunit/BSApiPageTemplatesStoreTest.php
@@ -4,11 +4,15 @@
  * @group medium
  * @group API
  * @group BlueSpice
- * @group BlueSpiceExtensions
  * @group BlueSpicePageTemplates
  */
 class BSApiPageTemplatesStoreTest extends BSApiExtJSStoreTestBase {
        protected $iFixtureTotal = 8;
+       protected $tablesUsed = [ 'bs_pagetemplate' ];
+
+       protected function skipAssertTotal() {
+               return true;
+       }
 
        protected function getStoreSchema () {
                return [
@@ -37,7 +41,14 @@
        }
 
        protected function createStoreFixtureData() {
-               new BSPageTemplateFixtures();
+               return;
+       }
+
+       public function addDBData() {
+               $oPageTemplateFixtures = new BSPageTemplateFixtures();
+               foreach( $oPageTemplateFixtures->makeDataSets() as $dataSet ) {
+                       $this->db->insert( 'bs_pagetemplate', $dataSet );
+               }
                return;
        }
 
diff --git a/tests/phpunit/utility/BSPageTemplateFixtures.php 
b/tests/phpunit/utility/BSPageTemplateFixtures.php
index efb3de0..66e05f3 100644
--- a/tests/phpunit/utility/BSPageTemplateFixtures.php
+++ b/tests/phpunit/utility/BSPageTemplateFixtures.php
@@ -3,15 +3,9 @@
 class BSPageTemplateFixtures {
 
        public function __construct() {
-               $dbw = wfGetDB( DB_MASTER );
-               $dbw->delete( 'bs_pagetemplate', '*' );
-
-               foreach( $this->makeDataSets() as $dataSet ) {
-                       $dbw->insert( 'bs_pagetemplate', $dataSet );
-               }
        }
 
-       protected function makeDataSets() {
+       public function makeDataSets() {
                return [
                        [
                                'pt_template_title' => 'Test_01',

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I71308c8de890bb589099d8d059c714fbf9e68e99
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpicePageTemplates
Gerrit-Branch: master
Gerrit-Owner: Dvogel hallowelt <[email protected]>
Gerrit-Reviewer: Ljonka <[email protected]>
Gerrit-Reviewer: Mglaser <[email protected]>
Gerrit-Reviewer: Pwirth <[email protected]>
Gerrit-Reviewer: Robert Vogel <[email protected]>

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

Reply via email to