jenkins-bot has submitted this change and it was merged.

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
---
M tests/ApiFlowThankIntegrationTest.php
1 file changed, 4 insertions(+), 4 deletions(-)

Approvals:
  Mattflaschen: Looks good to me, approved
  Jforrester: Looks good to me, but someone else must approve
  jenkins-bot: Verified



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/195296
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic80b137e6ca2f8ba6ad34ce0bdbb1319b81c0a6e
Gerrit-PatchSet: 7
Gerrit-Project: mediawiki/extensions/Thanks
Gerrit-Branch: master
Gerrit-Owner: Matthias Mullie <[email protected]>
Gerrit-Reviewer: EBernhardson <[email protected]>
Gerrit-Reviewer: Jforrester <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Mattflaschen <[email protected]>
Gerrit-Reviewer: Matthias Mullie <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to