[MediaWiki-commits] [Gerrit] Flow container needs to be reset before each test - change (mediawiki...Thanks)
Catrope 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 (cherry picked from commit ddf1310eea9c722c7596bab3ca0b2b0d2111a686) --- M tests/ApiFlowThankIntegrationTest.php 1 file changed, 4 insertions(+), 4 deletions(-) Approvals: Catrope: Verified; Looks good to me, approved 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: merged Gerrit-Change-Id: Ic80b137e6ca2f8ba6ad34ce0bdbb1319b81c0a6e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Thanks Gerrit-Branch: wmf/1.25wmf20 Gerrit-Owner: Jforrester Gerrit-Reviewer: Catrope Gerrit-Reviewer: Legoktm Gerrit-Reviewer: Matthias Mullie Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Flow container needs to be reset before each test - change (mediawiki...Thanks)
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 Gerrit-Reviewer: Matthias Mullie ___ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Flow container needs to be reset before each test - change (mediawiki...Thanks)
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 Gerrit-Reviewer: EBernhardson Gerrit-Reviewer: Jforrester Gerrit-Reviewer: Legoktm Gerrit-Reviewer: Mattflaschen Gerrit-Reviewer: Matthias Mullie Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
