[Argil-svn] SF.net SVN: argil: [513] branches/experimental
Status: Alpha
Brought to you by:
tswicegood
|
From: <tsw...@us...> - 2007-04-01 04:38:35
|
Revision: 513
http://argil.svn.sourceforge.net/argil/?rev=513&view=rev
Author: tswicegood
Date: 2007-03-31 21:38:34 -0700 (Sat, 31 Mar 2007)
Log Message:
-----------
Add in exception handling to Length Spec
Modified Paths:
--------------
branches/experimental/src/Argil/Specification/Length.php
branches/experimental/tests/Argil/Specification/LengthTest.php
Modified: branches/experimental/src/Argil/Specification/Length.php
===================================================================
--- branches/experimental/src/Argil/Specification/Length.php 2007-04-01 04:35:56 UTC (rev 512)
+++ branches/experimental/src/Argil/Specification/Length.php 2007-04-01 04:38:34 UTC (rev 513)
@@ -30,5 +30,7 @@
case '!=' :
return $actualLength != $this->_length;
}
+
+ throw new Exception();
}
}
\ No newline at end of file
Modified: branches/experimental/tests/Argil/Specification/LengthTest.php
===================================================================
--- branches/experimental/tests/Argil/Specification/LengthTest.php 2007-04-01 04:35:56 UTC (rev 512)
+++ branches/experimental/tests/Argil/Specification/LengthTest.php 2007-04-01 04:38:34 UTC (rev 513)
@@ -65,4 +65,13 @@
$this->assertFalse($spec->valid());
}
+ public function testThrowsExceptionOnUnknownComparisonType() {
+ $spec = new Argil_Specification_Length('12345', 5, 'unknown');
+ try {
+ $spec->valid();
+ $this->fail('Exception not caught');
+ } catch (Exception $e) {
+ $this->pass('Exception caught');
+ }
+ }
}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|