我最近使用PHPUnit参与了一些TDD.我必须测试一个数据库驱动的应用程序,并阅读DbUnit扩展,我计划在未来几周内研究和实施.
然而,我自己也遇到了这个人的演讲 - 塞巴斯蒂安·贝格曼 - 他有一张标题为"如果可以的话,避免对MySQL进行测试"的幻灯片,这对我的逃避产生了一些怀疑.
有人可以解释我不应该针对MySQL进行测试的原因吗?
谢谢
我试图从独立的OpenSocial(Atlassian Jira)小工具中使用以下REST资源.
我可以使用以下URL通过浏览器查询资源:
https://jira.atlassian.com/rest/api/latest/issue/JRA-9
我可以从我的开发机器发出相同的请求.它对我来说当然看起来像JSON ......但是,当我从我的小工具查询时,我得到了
GET 10.0.15.10:2990/jira/rest/api/latest/issue/CRD-1 415 Unsupported Media Type (32ms)
Run Code Online (Sandbox Code Playgroud)
响应以HTML格式返回.这是tomcat的响应主体:
<html><head><title>Apache Tomcat/6.0.20 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 415 - </h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>The server refused this request because the request entity is in a format not supported by the requested resource for the requested method ().</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/6.0.20</h3></body></html>
Run Code Online (Sandbox Code Playgroud)
这是我的AJAX调用(它本质上是包含在Atlassian小工具JavaScript框架中的JQuery ): …