[MediaWiki-commits] [Gerrit] Added ThrowingPatcherTest to test throwErrors and ignoreErrors - change (mediawiki...Diff)

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

Change subject: Added ThrowingPatcherTest to test throwErrors and ignoreErrors
..


Added ThrowingPatcherTest to test throwErrors and ignoreErrors

Change-Id: Ic4c5d90a0cc3b38dc68088051f3812e8b0d22c55
---
A tests/phpunit/patcher/ThrowingPatcherTest.php
1 file changed, 60 insertions(+), 0 deletions(-)

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



diff --git a/tests/phpunit/patcher/ThrowingPatcherTest.php 
b/tests/phpunit/patcher/ThrowingPatcherTest.php
new file mode 100644
index 000..0ec613c
--- /dev/null
+++ b/tests/phpunit/patcher/ThrowingPatcherTest.php
@@ -0,0 +1,60 @@
+http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ * @since 0.7
+ *
+ * @ingroup DiffTest
+ *
+ * @group Diff
+ * @group DiffPatcher
+ *
+ * @licence GNU GPL v2+
+ * @author Jeroen De Dauw < jeroended...@gmail.com >
+ */
+class ThrowingPatcherTest extends DiffTestCase {
+
+   public function testChangeThrowErrors() {
+   $patcher = $this->getMockForAbstractClass( 
'Diff\ThrowingPatcher' );
+
+   $class = new ReflectionClass( 'Diff\ThrowingPatcher' );
+   $method = $class->getMethod( 'handleError' );
+   $method->setAccessible( true );
+
+   $errorMessage = 'foo bar';
+
+   $method->invokeArgs( $patcher, array( $errorMessage ) );
+
+   $patcher->throwErrors();
+   $patcher->ignoreErrors();
+
+   $method->invokeArgs( $patcher, array( $errorMessage ) );
+
+   $patcher->throwErrors();
+   $this->setExpectedException( 'Diff\PatcherException' );
+
+   $method->invokeArgs( $patcher, array( $errorMessage ) );
+   }
+
+}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic4c5d90a0cc3b38dc68088051f3812e8b0d22c55
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Diff
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 
Gerrit-Reviewer: Denny Vrandecic 
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 ThrowingPatcherTest to test throwErrors and ignoreErrors - 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/65695


Change subject: Added ThrowingPatcherTest to test throwErrors and ignoreErrors
..

Added ThrowingPatcherTest to test throwErrors and ignoreErrors

Change-Id: Ic4c5d90a0cc3b38dc68088051f3812e8b0d22c55
---
A tests/phpunit/patcher/ThrowingPatcherTest.php
1 file changed, 60 insertions(+), 0 deletions(-)


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

diff --git a/tests/phpunit/patcher/ThrowingPatcherTest.php 
b/tests/phpunit/patcher/ThrowingPatcherTest.php
new file mode 100644
index 000..0ec613c
--- /dev/null
+++ b/tests/phpunit/patcher/ThrowingPatcherTest.php
@@ -0,0 +1,60 @@
+http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ * @since 0.7
+ *
+ * @ingroup DiffTest
+ *
+ * @group Diff
+ * @group DiffPatcher
+ *
+ * @licence GNU GPL v2+
+ * @author Jeroen De Dauw < jeroended...@gmail.com >
+ */
+class ThrowingPatcherTest extends DiffTestCase {
+
+   public function testChangeThrowErrors() {
+   $patcher = $this->getMockForAbstractClass( 
'Diff\ThrowingPatcher' );
+
+   $class = new ReflectionClass( 'Diff\ThrowingPatcher' );
+   $method = $class->getMethod( 'handleError' );
+   $method->setAccessible( true );
+
+   $errorMessage = 'foo bar';
+
+   $method->invokeArgs( $patcher, array( $errorMessage ) );
+
+   $patcher->throwErrors();
+   $patcher->ignoreErrors();
+
+   $method->invokeArgs( $patcher, array( $errorMessage ) );
+
+   $patcher->throwErrors();
+   $this->setExpectedException( 'Diff\PatcherException' );
+
+   $method->invokeArgs( $patcher, array( $errorMessage ) );
+   }
+
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic4c5d90a0cc3b38dc68088051f3812e8b0d22c55
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Diff
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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