[MediaWiki-commits] [Gerrit] Added testErrorOnUnknownDiffOpType to MapPatcherTest - change (mediawiki...Diff)

2013-05-28 Thread Denny Vrandecic (Code Review)
Denny Vrandecic has submitted this change and it was merged.

Change subject: Added testErrorOnUnknownDiffOpType to MapPatcherTest
..


Added testErrorOnUnknownDiffOpType to MapPatcherTest

Change-Id: I7b764195a7d752325afd5f5a8c92668cd849fc29
---
M tests/phpunit/patcher/MapPatcherTest.php
1 file changed, 19 insertions(+), 0 deletions(-)

Approvals:
  Denny Vrandecic: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/tests/phpunit/patcher/MapPatcherTest.php 
b/tests/phpunit/patcher/MapPatcherTest.php
index adf38a6..e389c82 100644
--- a/tests/phpunit/patcher/MapPatcherTest.php
+++ b/tests/phpunit/patcher/MapPatcherTest.php
@@ -360,4 +360,23 @@
$this-assertEquals( $expectedMap, $patchedMap );
}
 
+   public function testErrorOnUnknownDiffOpType() {
+   $patcher = new MapPatcher();
+
+   $diffOp = $this-getMock( 'Diff\DiffOp' );
+
+   $diffOp-expects( $this-any() )
+   -method( 'getType' )
+   -will( $this-returnValue( 'diff' ) );
+
+   $diff = new Diff( array( $diffOp ), true );
+
+   $patcher-patch( array(), $diff );
+
+   $patcher-throwErrors();
+   $this-setExpectedException( 'Diff\PatcherException' );
+
+   $patcher-patch( array(), $diff );
+   }
+
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7b764195a7d752325afd5f5a8c92668cd849fc29
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


[MediaWiki-commits] [Gerrit] Added testErrorOnUnknownDiffOpType to MapPatcherTest - change (mediawiki...Diff)

2013-05-27 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

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


Change subject: Added testErrorOnUnknownDiffOpType to MapPatcherTest
..

Added testErrorOnUnknownDiffOpType to MapPatcherTest

Change-Id: I7b764195a7d752325afd5f5a8c92668cd849fc29
---
M tests/phpunit/patcher/MapPatcherTest.php
1 file changed, 19 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Diff 
refs/changes/99/65699/1

diff --git a/tests/phpunit/patcher/MapPatcherTest.php 
b/tests/phpunit/patcher/MapPatcherTest.php
index adf38a6..e389c82 100644
--- a/tests/phpunit/patcher/MapPatcherTest.php
+++ b/tests/phpunit/patcher/MapPatcherTest.php
@@ -360,4 +360,23 @@
$this-assertEquals( $expectedMap, $patchedMap );
}
 
+   public function testErrorOnUnknownDiffOpType() {
+   $patcher = new MapPatcher();
+
+   $diffOp = $this-getMock( 'Diff\DiffOp' );
+
+   $diffOp-expects( $this-any() )
+   -method( 'getType' )
+   -will( $this-returnValue( 'diff' ) );
+
+   $diff = new Diff( array( $diffOp ), true );
+
+   $patcher-patch( array(), $diff );
+
+   $patcher-throwErrors();
+   $this-setExpectedException( 'Diff\PatcherException' );
+
+   $patcher-patch( array(), $diff );
+   }
+
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7b764195a7d752325afd5f5a8c92668cd849fc29
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Diff
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw jeroended...@gmail.com

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits