simpletest

Simpletest browser (php) on an asp site that doesn't allow direct linking

♀尐吖头ヾ 提交于 2019-12-13 08:06:58
问题 I'm trying to use Simpletest's scriptable browser to test out forms and links on an ASP site. See this site: http://www.acgme.org/adspublic/default.asp If you click on the links (under the "search" section) in the left frame, the content in the right frame changes. If I direct link to the links on the left, I get an error. Using simpletest: <?php require_once('../simpletest/browser.php'); $browser = &new SimpleBrowser(); $browser-> useCookies(); $browser-> useFrames(); $browser->get('http:/

database testing in php using phpunit,simpletest on api haveing stored procedure

微笑、不失礼 提交于 2019-12-13 05:24:54
问题 how can i do database testing with phpunit, i have done Google search on this but the problem is, my api is calling an stored procedure to interact with mysql and in phpunit i am unable to fire an stored procedure on the database XML file please check this https://stackoverflow.com/questions/21278242/phpunit-stored-procedure-database-testing https://stackoverflow.com/questions/21230707/testing-stored-procedure-which-is-call-within-an-api-in-php-using-either-phpunit And i have to create an XML

How do you run SimpleTest from Hudson?

牧云@^-^@ 提交于 2019-12-13 03:39:12
问题 I'm doing some work with CakePHP and want to use Hudson. I can run all kinds of plugins but I don't see anything for SimpleTest. Until Cake 2.0 comes out and they move to PHPUnit, I'd like to figure out how to run SimpleTest with Hudson. 回答1: This is an old question, but I thought I'd give my input... We are still stuck on cake 1.3 and are using Jenkins. We use stagehand-test runner to run the tests and generate the junit report. You can have your ant build run something like the following:

Simpletest PHP scriptable browser… how to test submit a form that has [ ] in the form name (basically in array format)?

情到浓时终转凉″ 提交于 2019-12-11 14:21:33
问题 I am using simpletest, the php scriptable browser and trying to test submit a form that is in array format so its like this: <input id="password" name="session[password]" value="" type="password"> Other input names start with "session" so I have to give the full name of each but it doesn't seem to work when I do it like this in my PHP script: $this->setField('session[password]', 'password'); I'm wondering if anyone knows of a way to do this properly, or can I set it to look at the input's id

PHP - Simpletest - How to test “included” classes

与世无争的帅哥 提交于 2019-12-11 12:50:36
问题 I have de follow code: include 'simpletest/autorun.php'; include 'config_test.case.php'; // <-- problem But it not works. I get: Bad TestSuite [index.php] with error [No runnable test cases in [index.php]] But if I put the Config class code directly (no "include"), it works. What can I do? Thx =) 回答1: Ensure you have the correct path to your test cases. I also use the PHP autoLoader() function to auto-magically resolve my own class paths so they don't need to be inclcuded in the paths. 来源:

Where is the PHPUnit report schema used by Jenkins?

偶尔善良 提交于 2019-12-11 09:48:47
问题 I am having problems getting Jenkins to parse a xunit.xml report file when there are exceptions in the tests. The XML looks well-formed so I can't see any problem just by looking at it. Is there a xsd file somewhere that I can compare my xml against to see what actually causing the file to be unparsable? About my setup: I set up a nightly job in Jenkins for a PHP project. We are using Cakephp 1.3 therefore we are still using SimpleTest instead of PHPUnit. The only way I could figure out to

Java基础1(String StringBuilder StringBuffer 三者区别)

眉间皱痕 提交于 2019-12-10 05:44:40
问题:String str =“niu”; 创建了一个对象 常量池 String str ="hah" +"oo"; 创建了三个对象 都在常量池 String str =new String("oo"); 创建了2个对象 一个在常量池,另外一个被复制到堆中 JVM包含5个,寄存器,方法区。栈,堆,本地方法区 而String 是final 类型,创建的对象要放到常量池中, http://blog.csdn.net/Meiyang1990/article/details/50857842 进入正文: 1 . 三者在执行速度方面的比较: StringBuilder > StringBuffer > String   2 . String <(StringBuffer,StringBuilder) 的原因     String:字符串常量     StringBuffer:字符创变量     StringBuilder:字符创变量 从上面的名字可以看到,String是“字符创常量”,也就是不可改变的对象。对于这句话的理解你可能会产生这样一个疑问 ,比如这段代码: 1 String s = "abcd"; 2 s = s+1; 3 System.out.print(s);// result : abcd1   我们明明就是改变了String型的变量s的,为什么说是没有改变呢?

Mocking PHP functions in unit tests

烈酒焚心 提交于 2019-12-09 08:42:50
问题 I'm unit-testing some PHP code with SimpleTest and I've run into trouble. In my tests of a database class I want to be able to set an expectation for PHPs mysql functions. In my tests of a wrapper class for the mail function I want to mock PHPs mail function. These are just some examples. The point is: I don't (always) want to test if my Mail class sends e-mail, I want to test how it calls the mail function. I want to be able to control what these functions return. I want to be able to test

Real-world testing of CakePHP controllers?

拟墨画扇 提交于 2019-12-07 06:36:43
问题 I'm writing a new application with CakePHP (just-released 1.2.4), using SimpleTest 1.0.1. I have read the relevant sections of the Cookbook, searched on the Bakery, and read Mark Story's postings on controller testing (the hard way and with mocks). Unfortunately, none of this talks about real-world testing of non-trivial controllers. Lots of apps put areas of the site behind a login, yet I cannot figure out how to test the simple scenario of: guest access to protected page redirects? valid

CodeIgniter and SimpleTest — How to make my first test?

送分小仙女□ 提交于 2019-12-06 07:16:48
问题 I'm used to web development using LAMP, PHP5, MySQL plus NetBeans with Xdebug. Now I want to improve my development, by learning how to use (A) proper testing and (B) a framework. So I have set up CodeIgniter, SimpleTest and the easy Xdebug add-in for Firefox. This is great fun because maroonbytes provided me with clear instructions and a configured setup ready for download. I am standing on the shoulders of giants, and very grateful. I've used SimpleTest a bit in the past. Here is a the kind