order = Order::q('select * from `order` where name="UNIT TEST ORDER" order by id_order desc limit 1')->get(0);
print_r($this->order);
}
public static function setUpBeforeClass() {
$order=new Order([
'name'=>'UNIT TEST ORDER'
]);
$order->save();
}
public function testSay() { //lowercase test, uppercase wtvr
$data = file_get_contents($GLOBALS['host-crunchbutton'].'api/order/'.$this->order->id_order.'/say');
$this->assertTrue($data == '
Hello. This is crunchbutton, with an order for pickup.Press 1 to hear the order. Otherwise we will call back in 2 minutes.Press 1 to hear the order. Otherwise we will call back in 2 minutes.Press 1 to hear the order. Otherwise we will call back in 2 minutes.Press 1 to hear the order. Otherwise we will call back in 2 minutes.' ? true : false);
}
//new one to fill
public function testSayOrder() { //lowercase test, uppercase wtvr
$order=new Order([
'name'=>'UNIT TEST ORDER'
]);
$order->save();
$data = file_get_contents($GLOBALS['host-crunchbutton'].'api/order/'.$order->id_order.'/sayorder');
echo $data;
echo '
Thank you. At the end of the message, you must confirm the order.Customer Phone number. .This order is for pickup. Order total: dollars and centsThe customer will be paying the tip . by cash.The customer will pay for this order with cash.Press 1 to repeat the order. Press 2 to confirm the order. Press 1 to repeat the order. Press 2 to confirm the order. Press 1 to repeat the order. Press 2 to confirm the order. Press 1 to repeat the order. Press 2 to confirm the order. ';
$this->assertTrue($data == '
Thank you. At the end of the message, you must confirm the order.Customer Phone number. .This order is for pickup. Order total: dollars and centsThe customer will be paying the tip . by cash.The customer will pay for this order with cash.Press 1 to repeat the order. Press 2 to confirm the order. Press 1 to repeat the order. Press 2 to confirm the order. Press 1 to repeat the order. Press 2 to confirm the order. Press 1 to repeat the order. Press 2 to confirm the order. ' ? true : false);
}
public function testSayOrderOnly() { //lowercase test, uppercase wtvr
$data = file_get_contents($GLOBALS['host-crunchbutton'].'api/order/'.$this->order->id_order.'/sayorderonly');
$this->assertTrue($data == '
Customer Phone number. .This order is for pickup. Order total: dollars and centsThe customer will be paying the tip . by cash.The customer will pay for this order with cash.Press 1 to repeat the order. Press 2 to confirm the order. Press 1 to repeat the order. Press 2 to confirm the order. Press 1 to repeat the order. Press 2 to confirm the order. Press 1 to repeat the order. Press 2 to confirm the order. ' ? true : false);
}
public function testDoConfirm() { //lowercase test, uppercase wtvr
$data = file_get_contents($GLOBALS['host-crunchbutton'].'api/order/'.$this->order->id_order.'/doconfirm');
$this->assertTrue($data == '
Hello. This is crunchbutton,.Please press 1 to confirm that you just received order number 167. Or press 2 and we will resend the order. . . .' ? true : false);
}
}//end file
*/