Пример #1
0
 /**
  *Test Getting Invalid Message by Message Text; messageText
  */
 public function testGetInvalidMessageByMessageText()
 {
     //create a new message
     $newMessage = new message(null, $this->VALID_MESSAGE_ID, $this->VALID_LISTING_Id, $this->VALID_ORG_ID, $this->VALID_MESSAGE_ID, $this->VALID_MESSAGE_TEXT);
     $newMessage->insert($this->getPDO());
     //grab the data from guzzle
     $response = $this->guzzle->get('http://bootcamp-coders.cnm.edu/~bread-basket/public_html/php/api/message/' . $newMessage - getMessage());
     $this->assertSame($response->getStatusCode(), 200);
     $body = $response->getBody();
     $alertLevel = json_decode($body);
     $this->assertSame(200, $alertLevel->status);
 }
Пример #2
0
/* completing information about selected recipients */
$sel_person += sel_items('sel_persons');
$sel_group += sel_items('sel_groups');
if ($action == 'write' || $action == 'preview' || $action == 'send') {
    if (count($sel_person) + count($sel_group) == 0) {
        $found = list_person_group();
        $sel_person = $found['person'];
        $sel_group = $found['group'];
    }
    if (isset($_POST['text'])) {
        $text = stripslashes($_POST['text']);
    }
    $msg = new message();
    $msg->create($text, $sel_person, $sel_group);
    if ($action == 'send') {
        $msg->insert();
        $_SESSION['notice'] = 'message sent';
        redirect('./');
    }
    if ($action == 'write' || $action == 'preview') {
        $message = '';
        $msg->format();
        $message = $msg->output;
        $v['message'] = $message;
        $v['sel_person'] = $sel_person;
        $v['sel_group'] = $sel_group;
        $v['text'] = $text;
        $content = new tmpl('new.html', $v);
    }
}
if ($action == 'start' || $action == 'search') {