コード例 #1
0
ファイル: ChangePeerTest.php プロジェクト: minishri9/dash
 public function testGetChanges()
 {
     $data = Application_Model_ChangePeer::getChanges('branchA', '88.ab99a3b7.5');
     $this->assertInternalType('array', $data);
     $this->assertEquals(1, count($data));
     $this->assertInstanceOf('Application_Model_Change', $data[0]);
     $this->assertAttributeEquals('88.ab99a3b7.5', 'id', $data[0]);
     $this->assertAttributeEquals("This, of course, is not the real copy for this advertisement. The real words will be written once...\nThis, of course, is not the real copy for this advertisement. The real words will be written once...", 'msg', $data[0]);
 }
コード例 #2
0
ファイル: ChangeController.php プロジェクト: minishri9/dash
 public function indexAction()
 {
     $regex = $this->getInvokeArg('bootstrap')->getOption('paramregex');
     if (preg_match($regex['bundle'], $this->_getParam('bundle')) === 0) {
         throw new Exception('Ungueltige Bundle Id');
     }
     $bundleId = $this->_getParam('bundle');
     if (preg_match($regex['branch'], $this->_getParam('branch')) === 0) {
         throw new Exception('Ungueltiger Branch');
     }
     $branch = $this->_getParam('branch');
     $data = $this->getEmptyResult();
     $data['results'] = Application_Model_ChangePeer::getChanges($branch, $bundleId);
     $this->getResponse()->setBody(json_encode($data));
     $this->getResponse()->setHttpResponseCode(200);
 }