Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


a test in the MootoolsEngineHelper testcase was ignoring asserts #196

wants to merge 1 commit into from

2 participants


In the test for MootoolsEngineHelper::drop() there is a expectError(). Because of this assert the asserts on the next lines are never run and never tests the actual drop() function.

I fixed this by splitting them up and moving the error checking assert into its own test function.


Thanks for the patch. expectError should probably be removed from all the tests in 2.0. The PHPUnit annotations are much better for this use.


What about the idea of helpers throwing exceptions?

This function could throw a MissingParameterException


I think an exception here makes sense.


Landed in [aa45452]. I left the trigger_error as is for now, but it could be an exception.

@markstory markstory closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 8, 2011
  1. @jellehenkens
This page is out of date. Refresh to see the latest.
Showing with 11 additions and 3 deletions.
  1. +11 −3 lib/Cake/Test/Case/View/Helper/MootoolsEngineHelperTest.php
14 lib/Cake/Test/Case/View/Helper/MootoolsEngineHelperTest.php
@@ -263,12 +263,13 @@ public function testDrag() {
$expected = '$("drag-me").makeDraggable({onComplete:onStop, onDrag:onDrag, onStart:onStart, snap:[10,10]});';
$this->assertEqual($expected, $result);
- * test drop() method
+ * test drop() method with the required drag option missing
* @return void
- public function testDrop() {
+ public function testDropWithMissingOption() {
@@ -276,7 +277,14 @@ public function testDrop() {
'leave' => 'onLeave',
'hover' => 'onHover',
+ }
+ * test drop() method
+ *
+ * @return void
+ */
+ public function testDrop() {
+ $this->Moo->get('#drop-me');
$result = $this->Moo->drop(array(
'drop' => 'onDrop',
'leave' => 'onLeave',
Something went wrong with that request. Please try again.