用户
 找回密码
 入住 CI 中国社区
搜索
查看: 2360|回复: 0
收起左侧

[HELP] 用fixtures 要怎么导入POINT数据

[复制链接]
发表于 2013-4-8 22:00:11 | 显示全部楼层 |阅读模式
本帖最后由 去年明日 于 2013-4-8 22:03 编辑

我参照 http://codeigniter.org.cn/forums/forum.php?mod=viewthread&tid=12205&reltid=14593&pre_thread_id=0&pre_pos=1&ext= 用PHPUNIT来测试代码,

我在 system/tests/fixtures 创建了一个 request_fixt.yml , 要下列内容添加到request_fixt.yml 中

PHP复制代码
1:
    user_id: 2
    homedesc: 'Home Description of Verky'
    homecoord: POINT(31.229239,121.421031)
    officedesc: 'Office Description of Verky'
    officecoord: POINT(31.229239,121.421031)
    want: 1
    fees: '10'
    submit:
 
复制代码


我的测试数据库ciunit_test库中创建了一个request表
字段                                                                             数据类型                                                                  是否为空
user_idint(11)NO
homedescchar(50)YES
homecoordpointYES
officedescchar(50)YES
officecoordpointYES
wanttinyint(4)YES
feestinyint(4)YES
submittimestampNO

在控制器中导入  执行
PHP复制代码
$this->dbfixt('request');
复制代码
导入数据失败,请问下POINT类型的数据要怎么用fixtures 导入数据,要以什么格式

本版积分规则