Denny Vrandecic has submitted this change and it was merged. Change subject: Add unhappy path test to DiffTest ......................................................................
Add unhappy path test to DiffTest Change-Id: I31abcd1a5273ce8b600a1bb33130924c4653f9c6 --- M tests/phpunit/diffop/diff/DiffTest.php 1 file changed, 19 insertions(+), 0 deletions(-) Approvals: Denny Vrandecic: Looks good to me, approved jenkins-bot: Verified diff --git a/tests/phpunit/diffop/diff/DiffTest.php b/tests/phpunit/diffop/diff/DiffTest.php index 137686d..5f41319 100644 --- a/tests/phpunit/diffop/diff/DiffTest.php +++ b/tests/phpunit/diffop/diff/DiffTest.php @@ -610,5 +610,24 @@ $this->assertArrayEquals( $list, $copy, true, true ); } + /** + * @dataProvider instanceProvider + * + * @since 0.6 + * + * @param Diff $list + */ + public function testAddInvalidDiffOp( Diff $list ) { + $invalidDiffOp = $this->getMock( 'Diff\DiffOp' ); + + $invalidDiffOp->expects( $this->atLeastOnce() ) + ->method( 'getType' ) + ->will( $this->returnValue( '~=[,,_,,]:3' ) ); + + $this->setExpectedException( 'Exception' ); + + $list->append( $invalidDiffOp ); + } + } -- To view, visit https://gerrit.wikimedia.org/r/64806 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I31abcd1a5273ce8b600a1bb33130924c4653f9c6 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Diff Gerrit-Branch: master Gerrit-Owner: Jeroen De Dauw <jeroended...@gmail.com> Gerrit-Reviewer: Denny Vrandecic <denny.vrande...@wikimedia.de> Gerrit-Reviewer: jenkins-bot _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits