/** * test_action_json * * @access public * @return void */ public function test_action_json() { $post_data = array('page' => 1, 'page_count' => 20, 'madapter_id' => 1); // 初始化 POST 参数 sw_request::get_instance($post_data); $result = $this->__device->action_json(); $expect = 10000; $this->assertEquals($expect, $result['code']); $query_table = $this->array_to_dbset(array('device_info' => $result['data']['result']))->getTable('device_info'); $expect = $this->createXMLDataSet(dirname(__FILE__) . '/_files/get_result.xml')->getTable('device_info'); $this->assertTablesEqual($expect, $query_table); }
/** * 初始化 * * @access public * @return void */ public function init() { $this->__request = \mock\api_test\sw_request::get_instance(); }
/** * test_action_json * * @access public * @return void */ public function test_action_json() { $post_data = array('start' => 0, 'length' => 10); // 初始化 POST 参数 sw_request::get_instance($post_data); $result = $this->__madapter->action_json(); $expect = 10000; $this->assertEquals($expect, $result['code']); $query_table = $this->array_to_dbset(array('madapter_basic' => $result['data']['result']))->getTable('madapter_basic'); $expect = $this->createXMLDataSet(dirname(__FILE__) . '/_files/get_result.xml')->getTable('madapter_basic'); $this->assertTablesEqual($expect, $query_table); }
/** * test_action_madapter * * @access public * @return void */ public function test_action_madapter() { $post_data = array(); // 初始化 POST 参数 sw_request::get_instance($post_data); $result = $this->__dconfig->action_madapter(); $expect = 10000; $this->assertEquals($expect, $result['code']); $expect = (include dirname(__FILE__) . '/_files/madapter_result.php'); $this->assertEquals($result['data'], $expect); }