Ejemplo n.º 1
0
 /**
  * @depends testWhetherACsrfCounterMeasureIsNotBeingAdded
  * @depends testWhetherAUniqueFormIdIsNotBeingAdded
  * @depends testWhetherNoSubmitButtonIsAddedWithoutASubmitLabelBeingSet
  */
 public function testWhetherAClosureCanBePassedAsOnSuccessCallback()
 {
     $request = new Request();
     $form = new Form(array('onSuccess' => function ($form) {
         $form->getRequest()->setParam('test', 'tset');
         return false;
     }));
     $form->setTokenDisabled();
     $form->setUidDisabled();
     $form->handleRequest($request);
     $this->assertEquals('tset', $request->getParam('test'), 'Form does not utilize the onSuccess callback set with form options on instantiation');
 }