/** * Test Save Function */ public function testSave() { $sms = new SMS(); $token = $sms->get_auth_token(); $date = date('Y-m-d H:i:s'); $sms->save('00001111', '1', '2', 'testing', $date, $token); $resultingTable = $this->getConnection()->createQueryTable("mo", "SELECT msisdn,operatorid,shortcodeid,text FROM mo WHERE msisdn = '00001111' and text = 'testing' LIMIT 1"); $expectedTable = $this->createXmlDataSet("expected_data.xml")->getTable("mo"); $this->assertTablesEqual($expectedTable, $resultingTable); echo 'Test 2: (Saving to Database): {"status": "ok"}' . PHP_EOL; }
<?php require_once 'functions.php'; $sms = new SMS(); $token = $sms->get_auth_token(); $sms->save($_REQUEST['msisdn'], $_REQUEST['operatorid'], $_REQUEST['shortcodeid'], $_REQUEST['text'], null, $token);