예제 #1
0
 /**
  * Test prepareUrl method
  * 
  * @return void
  */
 public function _testPrepareUrl()
 {
     $expected = $url = array('controller' => 'articles', 'action' => 'view', 'my-first-article');
     $this->assertEqual($this->CommentWidget->prepareUrl($url), $expected);
     $this->Js->setReturnValue('get', $this->Js);
     $this->Js->setReturnValue('effect', '');
     $this->CommentWidget->options(array('target' => 'placeholder', 'ajaxAction' => 'add'));
     $expected['action'] = 'add';
     $this->assertEqual($this->CommentWidget->prepareUrl($url), $expected);
     $this->CommentWidget->options(array('target' => 'placeholder', 'ajaxAction' => array('controller' => 'comments', 'action' => 'add')));
     $expected = array('controller' => 'comments', 'action' => 'add', 'my-first-article');
     $this->assertEqual($this->CommentWidget->prepareUrl($url), $expected);
 }