Ejemplo n.º 1
0
 public function testDojoHelperCanEnableLayoutsAndViewRenderer()
 {
     $dojo = new Zend_Controller_Action_Helper_AutoCompleteDojo();
     $dojo->suppressExit = true;
     $data = array('foo', 'bar', 'baz');
     $encoded = $dojo->direct($data, false, true);
     $this->assertTrue($this->layout->isEnabled());
     $this->assertFalse($this->viewRenderer->getNoRender());
 }
Ejemplo n.º 2
0
 /**
  * @group   ZF-9126
  */
 public function testDojoHelperEncodesUnicodeChars()
 {
     $dojo = new Zend_Controller_Action_Helper_AutoCompleteDojo();
     $dojo->suppressExit = true;
     $data = array('garçon', 'schließen', 'Helgi Þormar Þorbjörnsson');
     $encoded = $dojo->direct($data);
     $body = $this->response->getBody();
     $decoded = Zend_Json::decode($encoded);
     $test = array();
     foreach ($decoded['items'] as $item) {
         $test[] = $item['name'];
     }
     $this->assertSame($data, $test);
     $this->assertSame($encoded, $body);
 }