Jforrester has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/195470

Change subject: Flow container needs to be reset before each test
......................................................................

Flow container needs to be reset before each test

Pimple throws an exception when overriding something that was
already fetched from container.
This is currently causing some extensions trouble.

To prevent shared state between tests the flow container 
needs to be reset in the setUp() routine of all tests
accesing the container.

Bug: T91967
Change-Id: Ic80b137e6ca2f8ba6ad34ce0bdbb1319b81c0a6e
(cherry picked from commit ddf1310eea9c722c7596bab3ca0b2b0d2111a686)
---
M tests/ApiFlowThankIntegrationTest.php
1 file changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Thanks 
refs/changes/70/195470/1

diff --git a/tests/ApiFlowThankIntegrationTest.php 
b/tests/ApiFlowThankIntegrationTest.php
index b454e09..59794a5 100644
--- a/tests/ApiFlowThankIntegrationTest.php
+++ b/tests/ApiFlowThankIntegrationTest.php
@@ -74,9 +74,6 @@
                                }
                        ) );
 
-               $container = Flow\Container::getContainer();
-               $container[ 'loader.root_post' ] = $mockLoader;
-
                $mockWorkflow = $this->getMock( '\Flow\Model\Workflow' );
                $mockWorkflow->expects( $this->any() )
                        ->method( 'getOwnerTitle' )
@@ -90,7 +87,6 @@
                        ->method( 'get' )
                        ->will( $this->returnValue( $mockWorkflow ) );
 
-               $container[ 'storage' ] = $mockStorage;
 
                $mockTemplating = $this->getMockBuilder( 'Flow\Templating' )
                        ->disableOriginalConstructor()
@@ -100,6 +96,10 @@
                        ->method( 'getContent' )
                        ->will( $this->returnValue( 'test content' ) );
 
+               Flow\Container::reset();
+               $container = Flow\Container::getContainer();
+               $container[ 'loader.root_post' ] = $mockLoader;
+               $container[ 'storage' ] = $mockStorage;
                $container[ 'templating' ] = $mockTemplating;
 
                $this->doLogin( 'sysop' );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic80b137e6ca2f8ba6ad34ce0bdbb1319b81c0a6e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Thanks
Gerrit-Branch: wmf/1.25wmf20
Gerrit-Owner: Jforrester <[email protected]>
Gerrit-Reviewer: Matthias Mullie <[email protected]>

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

Reply via email to