Example #1
0
 /**
  * @test
  */
 public function shouldSetNeededDataUsingSetter()
 {
     $process = new Process();
     $process->setScenarioAlias('alias');
     $process->setDisplayRoute('displayRoute');
     $process->setDisplayRouteParams(array('foo' => 'bar'));
     $process->setForwardRoute('forwardRoute');
     $process->setForwardRouteParams(array('foo' => 'bar'));
     $process->setRedirect('http://somepage');
     $process->setRedirectParams(array('foo' => 'bar'));
     $process->setValidator(new ProcessValidator('An error occurred.', null, function () {
         return false;
     }));
     $validator = $process->getValidator();
     $this->assertSame('alias', $process->getScenarioAlias());
     $this->assertSame('displayRoute', $process->getDisplayRoute());
     $this->assertSame(array('foo' => 'bar'), $process->getDisplayRouteParams());
     $this->assertSame('forwardRoute', $process->getForwardRoute());
     $this->assertSame(array('foo' => 'bar'), $process->getForwardRouteParams());
     $this->assertSame('http://somepage', $process->getRedirect());
     $this->assertSame(array('foo' => 'bar'), $process->getRedirectParams());
     $this->assertSame(false, $validator->isValid());
 }