You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(4) |
Sep
(14) |
Oct
(22) |
Nov
(21) |
Dec
(7) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(4) |
Feb
(26) |
Mar
(62) |
Apr
(60) |
May
(73) |
Jun
(41) |
Jul
(64) |
Aug
(39) |
Sep
(19) |
Oct
(18) |
Nov
(55) |
Dec
(24) |
2005 |
Jan
(35) |
Feb
(122) |
Mar
(130) |
Apr
(62) |
May
(57) |
Jun
(103) |
Jul
(71) |
Aug
(142) |
Sep
(67) |
Oct
(27) |
Nov
(49) |
Dec
(56) |
2006 |
Jan
(42) |
Feb
(65) |
Mar
(30) |
Apr
(43) |
May
(13) |
Jun
(25) |
Jul
(5) |
Aug
(14) |
Sep
(18) |
Oct
(55) |
Nov
(126) |
Dec
(82) |
2007 |
Jan
(83) |
Feb
(83) |
Mar
(173) |
Apr
(30) |
May
(64) |
Jun
(156) |
Jul
(50) |
Aug
(29) |
Sep
(25) |
Oct
(26) |
Nov
(51) |
Dec
(9) |
2008 |
Jan
(36) |
Feb
(71) |
Mar
(93) |
Apr
(123) |
May
(34) |
Jun
(14) |
Jul
(21) |
Aug
(26) |
Sep
(49) |
Oct
(38) |
Nov
(19) |
Dec
(46) |
2009 |
Jan
(18) |
Feb
(16) |
Mar
(46) |
Apr
(4) |
May
(18) |
Jun
(9) |
Jul
(11) |
Aug
(4) |
Sep
(31) |
Oct
(19) |
Nov
(4) |
Dec
(11) |
2010 |
Jan
(15) |
Feb
(9) |
Mar
|
Apr
(20) |
May
(5) |
Jun
(8) |
Jul
(2) |
Aug
(9) |
Sep
(6) |
Oct
(21) |
Nov
(20) |
Dec
(11) |
2011 |
Jan
(11) |
Feb
(5) |
Mar
(6) |
Apr
(1) |
May
(12) |
Jun
(4) |
Jul
(1) |
Aug
(3) |
Sep
(4) |
Oct
(3) |
Nov
(3) |
Dec
(5) |
2012 |
Jan
(28) |
Feb
(7) |
Mar
(3) |
Apr
|
May
(5) |
Jun
(6) |
Jul
(5) |
Aug
(4) |
Sep
|
Oct
(4) |
Nov
(5) |
Dec
(4) |
2013 |
Jan
|
Feb
|
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
(3) |
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
(5) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(7) |
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2016 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
(4) |
Jun
(1) |
Jul
|
Aug
(2) |
Sep
(3) |
Oct
|
Nov
(1) |
Dec
|
2017 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Ken I. <ken...@gm...> - 2013-03-08 20:35:51
|
The testing scripts are producing blank HTML with my apache server, but outputting the appropriate results in the bash shell. Are there some configuration issues that I am missing? I am building the directory /var/www/simpletest Subdirectories classes temp tests tests/simpletest Testing script TestOfLogging.php I have not done unit testing before so I'm just working to get a handle on the concept as quickly as possible. |
From: Adonis El F. <ad...@ay...> - 2012-12-31 09:43:04
|
Hi Guys, I tried to use the recorder class but I am not getting anywhere, i can run an individual test extending UnitTestCase and the HtmlReporter If I try the same with a recorder I get "Missing argument 1 for SimpleReporterDecorator::__construct()," this is what I am trying to execute. Does anyone know how to grab the run results for a unit test into an array? the reporter example is using a testsuite and autorun which I can not run inside my app. Any ideas? --- code snippet -start --- require_once('simpletest/unit_tester'); //note the unit_tester not autorun require_once('simpletest/recorder.php'); require_once('simpletest/reporter'); $test = new test_smarty_function_hello_world($plugin_vars,$local_vars); $test->run(new HtmlReporter()); // this works $test->run(run Recorder()); // this does not class test_smarty_function_hello_world extends UnitTestCase { var $plugin_vars; var $local_vars; function test_smarty_function_hello_world($plugin_vars,$local_vars) { $this->plugin_vars = $plugin_vars; $this->locale = $local_vars['locale']; $this->time = $local_vars['time']; $this->debug = $local_vars['debug']; $this->business_id = $local_vars['business_id']; } function testIfPuntoObjectNotNull() { $this->assertNotNull($this->plugin_vars); } function testIfParamsDebugIsFalse() { $this->assertFalse($this->debug); } } ---- end code snippet -- On Dec 20, 2012, at 7:13 AM, Adonis El Fakih wrote: Hi Perrick, Thanks a lot. I believe that is what I need. I had not explored the experimental code yet, will try this. Regards Adonis On Dec 19, 2012, at 11:26 PM, Perrick Penet-Avez wrote: Have you tried to use the Recorder ? http://simpletest.org/en/experimental_recorder.html It could prove useful. Yours, Perrick On 19/12/12 21:53, Adonis El Fakih wrote: > Hi, > > I am trying to do something a little different than usual with simpletest. > > I am embedding tests in existing code that is used on a web environment, and most of our code is procedural so at certain checkpoints we execute the tests. > > Our code already outputs text that goes to the web interface, and what we would like to do is have the simpletest reports be sent to a file, that we can open from a different interface and if it is xml, can be fed to an xUnit parser. Right now when we execute the tests, the output is clearly seen in the web page, so we are looking for a way to make the simpletest report message go to a file or a variable. > > Right now I call the code simply like this > > $test = new test_smarty_punto_display_menu($punto_object,$params,$time_start,$time_end); > $test->run(new HtmlReporter()); > > where the class file has this > > require_once(dirname(__FILE__) . '/simpletest/unit_tester.php'); > require_once(dirname(__FILE__) . '/simpletest/reporter.php'); > > class test_smarty_punto_display_menu extends UnitTestCase > { > var $punto_object; // pass the punto_object to do some sanity tests on it > var $params; //pass the params coming in to see if they are complete > var $time_start; > var $time_end; > > function test_smarty_punto_display_menu($punto_object,$params,$time_start,$time_end) { > $this->punto_object = $punto_object; > $this->params = $params; > $this->time_start=$time_start; > $this->time_end=$time_end; > } > > function setUp() { } > > function testIfPuntoObjectNotNull() > { > $this->assertNotNull($this->punto_object); > } > > function testIfParamsDebugIsFalse() > { > $params = $this->params; > $this->assertFalse($params['debug']); > } > > function testIfParamsLocaleIsTrue() > { > $params = $this->params; > $this->assertTrue($params['locale']); > } > > function testIfExecTimeIsLessThanHalfASecond() > { > $value = $this->time_end - $this->time_start ; > $this->assertTrue($value < 0.5); > } > > function testIfParamsLayoutIsVerticalOrHorizontal() > { > if ( $this->params['layout'] == 'vertical' || $this->params['layout'] == 'horizontal' ) { > $is_valid = TRUE; > } else { > $is_valid = FALSE; > } > $this->assertTrue($is_valid); > } > > function tearDown() { } > } > > > Since our code is already called from web, and it has output, I would like to get the reporter send it to a log file. > > I have poked around in code, documentation and web searches and no luck in finding hints on how to do this. Is it possible? How can I run the test and be able to direct the output to a variable to be printed or saved to a log file. It would be awesome if I can still use the three report styles text, html and xml so we can use the output format that is best for the occasion. > > Please note that I can not run the code on command line. Any help would be GREATLY appreciated! > > Adonis > > > > > ------------------------------------------------------------------------------ > LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial > Remotely access PCs and mobile devices and provide instant support > Improve your efficiency, and focus on delivering more value-add services > Discover what IT Professionals Know. Rescue delivers > http://p.sf.net/sfu/logmein_12329d2d > _______________________________________________ > Simpletest-support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpletest-support > -- ----- Opentime.fr : logiciel web de gestion du temps et suivi d'activité http://opentime.fr/ ------------------------------------------------------------------------------ LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d _______________________________________________ Simpletest-support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simpletest-support |
From: Adonis El F. <ad...@ay...> - 2012-12-20 05:13:31
|
Hi Perrick, Thanks a lot. I believe that is what I need. I had not explored the experimental code yet, will try this. Regards Adonis On Dec 19, 2012, at 11:26 PM, Perrick Penet-Avez wrote: Have you tried to use the Recorder ? http://simpletest.org/en/experimental_recorder.html It could prove useful. Yours, Perrick On 19/12/12 21:53, Adonis El Fakih wrote: > Hi, > > I am trying to do something a little different than usual with simpletest. > > I am embedding tests in existing code that is used on a web environment, and most of our code is procedural so at certain checkpoints we execute the tests. > > Our code already outputs text that goes to the web interface, and what we would like to do is have the simpletest reports be sent to a file, that we can open from a different interface and if it is xml, can be fed to an xUnit parser. Right now when we execute the tests, the output is clearly seen in the web page, so we are looking for a way to make the simpletest report message go to a file or a variable. > > Right now I call the code simply like this > > $test = new test_smarty_punto_display_menu($punto_object,$params,$time_start,$time_end); > $test->run(new HtmlReporter()); > > where the class file has this > > require_once(dirname(__FILE__) . '/simpletest/unit_tester.php'); > require_once(dirname(__FILE__) . '/simpletest/reporter.php'); > > class test_smarty_punto_display_menu extends UnitTestCase > { > var $punto_object; // pass the punto_object to do some sanity tests on it > var $params; //pass the params coming in to see if they are complete > var $time_start; > var $time_end; > > function test_smarty_punto_display_menu($punto_object,$params,$time_start,$time_end) { > $this->punto_object = $punto_object; > $this->params = $params; > $this->time_start=$time_start; > $this->time_end=$time_end; > } > > function setUp() { } > > function testIfPuntoObjectNotNull() > { > $this->assertNotNull($this->punto_object); > } > > function testIfParamsDebugIsFalse() > { > $params = $this->params; > $this->assertFalse($params['debug']); > } > > function testIfParamsLocaleIsTrue() > { > $params = $this->params; > $this->assertTrue($params['locale']); > } > > function testIfExecTimeIsLessThanHalfASecond() > { > $value = $this->time_end - $this->time_start ; > $this->assertTrue($value < 0.5); > } > > function testIfParamsLayoutIsVerticalOrHorizontal() > { > if ( $this->params['layout'] == 'vertical' || $this->params['layout'] == 'horizontal' ) { > $is_valid = TRUE; > } else { > $is_valid = FALSE; > } > $this->assertTrue($is_valid); > } > > function tearDown() { } > } > > > Since our code is already called from web, and it has output, I would like to get the reporter send it to a log file. > > I have poked around in code, documentation and web searches and no luck in finding hints on how to do this. Is it possible? How can I run the test and be able to direct the output to a variable to be printed or saved to a log file. It would be awesome if I can still use the three report styles text, html and xml so we can use the output format that is best for the occasion. > > Please note that I can not run the code on command line. Any help would be GREATLY appreciated! > > Adonis > > > > > ------------------------------------------------------------------------------ > LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial > Remotely access PCs and mobile devices and provide instant support > Improve your efficiency, and focus on delivering more value-add services > Discover what IT Professionals Know. Rescue delivers > http://p.sf.net/sfu/logmein_12329d2d > _______________________________________________ > Simpletest-support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpletest-support > -- ----- Opentime.fr : logiciel web de gestion du temps et suivi d'activité http://opentime.fr/ ------------------------------------------------------------------------------ LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d _______________________________________________ Simpletest-support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simpletest-support |
From: Perrick Penet-A. <pe...@no...> - 2012-12-19 22:43:25
|
Have you tried to use the Recorder ? http://simpletest.org/en/experimental_recorder.html It could prove useful. Yours, Perrick On 19/12/12 21:53, Adonis El Fakih wrote: > Hi, > > I am trying to do something a little different than usual with simpletest. > > I am embedding tests in existing code that is used on a web environment, and most of our code is procedural so at certain checkpoints we execute the tests. > > Our code already outputs text that goes to the web interface, and what we would like to do is have the simpletest reports be sent to a file, that we can open from a different interface and if it is xml, can be fed to an xUnit parser. Right now when we execute the tests, the output is clearly seen in the web page, so we are looking for a way to make the simpletest report message go to a file or a variable. > > Right now I call the code simply like this > > $test = new test_smarty_punto_display_menu($punto_object,$params,$time_start,$time_end); > $test->run(new HtmlReporter()); > > where the class file has this > > require_once(dirname(__FILE__) . '/simpletest/unit_tester.php'); > require_once(dirname(__FILE__) . '/simpletest/reporter.php'); > > class test_smarty_punto_display_menu extends UnitTestCase > { > var $punto_object; // pass the punto_object to do some sanity tests on it > var $params; //pass the params coming in to see if they are complete > var $time_start; > var $time_end; > > function test_smarty_punto_display_menu($punto_object,$params,$time_start,$time_end) { > $this->punto_object = $punto_object; > $this->params = $params; > $this->time_start=$time_start; > $this->time_end=$time_end; > } > > function setUp() { } > > function testIfPuntoObjectNotNull() > { > $this->assertNotNull($this->punto_object); > } > > function testIfParamsDebugIsFalse() > { > $params = $this->params; > $this->assertFalse($params['debug']); > } > > function testIfParamsLocaleIsTrue() > { > $params = $this->params; > $this->assertTrue($params['locale']); > } > > function testIfExecTimeIsLessThanHalfASecond() > { > $value = $this->time_end - $this->time_start ; > $this->assertTrue($value < 0.5); > } > > function testIfParamsLayoutIsVerticalOrHorizontal() > { > if ( $this->params['layout'] == 'vertical' || $this->params['layout'] == 'horizontal' ) { > $is_valid = TRUE; > } else { > $is_valid = FALSE; > } > $this->assertTrue($is_valid); > } > > function tearDown() { } > } > > > Since our code is already called from web, and it has output, I would like to get the reporter send it to a log file. > > I have poked around in code, documentation and web searches and no luck in finding hints on how to do this. Is it possible? How can I run the test and be able to direct the output to a variable to be printed or saved to a log file. It would be awesome if I can still use the three report styles text, html and xml so we can use the output format that is best for the occasion. > > Please note that I can not run the code on command line. Any help would be GREATLY appreciated! > > Adonis > > > > > ------------------------------------------------------------------------------ > LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial > Remotely access PCs and mobile devices and provide instant support > Improve your efficiency, and focus on delivering more value-add services > Discover what IT Professionals Know. Rescue delivers > http://p.sf.net/sfu/logmein_12329d2d > _______________________________________________ > Simpletest-support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpletest-support > -- ----- Opentime.fr : logiciel web de gestion du temps et suivi d'activité http://opentime.fr/ |
From: Adonis El F. <ad...@ay...> - 2012-12-19 21:06:13
|
Hi, I am trying to do something a little different than usual with simpletest. I am embedding tests in existing code that is used on a web environment, and most of our code is procedural so at certain checkpoints we execute the tests. Our code already outputs text that goes to the web interface, and what we would like to do is have the simpletest reports be sent to a file, that we can open from a different interface and if it is xml, can be fed to an xUnit parser. Right now when we execute the tests, the output is clearly seen in the web page, so we are looking for a way to make the simpletest report message go to a file or a variable. Right now I call the code simply like this $test = new test_smarty_punto_display_menu($punto_object,$params,$time_start,$time_end); $test->run(new HtmlReporter()); where the class file has this require_once(dirname(__FILE__) . '/simpletest/unit_tester.php'); require_once(dirname(__FILE__) . '/simpletest/reporter.php'); class test_smarty_punto_display_menu extends UnitTestCase { var $punto_object; // pass the punto_object to do some sanity tests on it var $params; //pass the params coming in to see if they are complete var $time_start; var $time_end; function test_smarty_punto_display_menu($punto_object,$params,$time_start,$time_end) { $this->punto_object = $punto_object; $this->params = $params; $this->time_start=$time_start; $this->time_end=$time_end; } function setUp() { } function testIfPuntoObjectNotNull() { $this->assertNotNull($this->punto_object); } function testIfParamsDebugIsFalse() { $params = $this->params; $this->assertFalse($params['debug']); } function testIfParamsLocaleIsTrue() { $params = $this->params; $this->assertTrue($params['locale']); } function testIfExecTimeIsLessThanHalfASecond() { $value = $this->time_end - $this->time_start ; $this->assertTrue($value < 0.5); } function testIfParamsLayoutIsVerticalOrHorizontal() { if ( $this->params['layout'] == 'vertical' || $this->params['layout'] == 'horizontal' ) { $is_valid = TRUE; } else { $is_valid = FALSE; } $this->assertTrue($is_valid); } function tearDown() { } } Since our code is already called from web, and it has output, I would like to get the reporter send it to a log file. I have poked around in code, documentation and web searches and no luck in finding hints on how to do this. Is it possible? How can I run the test and be able to direct the output to a variable to be printed or saved to a log file. It would be awesome if I can still use the three report styles text, html and xml so we can use the output format that is best for the occasion. Please note that I can not run the code on command line. Any help would be GREATLY appreciated! Adonis |
From: tamouse m. l. <tam...@gm...> - 2012-11-17 15:07:44
|
On Sat, Nov 17, 2012 at 2:33 AM, kaescrat <kae...@ao...> wrote: > I know that SimpleTest would work on others environments (and in my > vms), that's not my point SimpleTest is a great software. I believe that is exactly where I started: > Le 17/11/2012 04:26, tamouse mailing lists a écrit : >> I can't solve your particular issue with free.fr, but I might be able >> to offer and alternative? > The possibility of someone hacking my internet site ? Sorry, this answer > is highly unlikely the source of my problem : Nor was it intended to be. It was a statement of your using a public site to develop and test your application, which may expose your site to hacking if you haven't fully developed and tested it yet. > I think this the problem may be with fopen or something else not allowed > to open something in another network etc.. This is a configurable item, which you may not be *able* to configure on free.fr, but you could on your own VM. |
From: kaescrat <kae...@ao...> - 2012-11-17 08:34:07
|
Le 17/11/2012 04:26, tamouse mailing lists a écrit : > On Fri, Nov 16, 2012 at 3:54 AM, kaescrat <kae...@ao...> wrote: >> Hi :-) >> >> I'm trying to get SimpleTest working on a french free ftp provider >> (free.fr). It's php 5 (I added a htaccess for that) but I can't get this >> to work : > Hi, > > I can't solve your particular issue with free.fr, but I might be able > to offer and alternative? > > What if you set up a local Virtual Machine (using, say Virtual Box) > and run the tests against that? That way you can control the entire > environment from top to bottom and not incure the possibility of > someone hacking your internet site while it's still under development? > > ------------------------------------------------------------------------------ > Monitor your physical, virtual and cloud infrastructure from a single > web console. Get in-depth insight into apps, servers, databases, vmware, > SAP, cloud infrastructure, etc. Download 30-day Free Trial. > Pricing starts from $795 for 25 servers or applications! > http://p.sf.net/sfu/zoho_dev2dev_nov > _______________________________________________ > Simpletest-support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpletest-support I know that SimpleTest would work on others environments (and in my vms), that's not my point SimpleTest is a great software. The possibility of someone hacking my internet site ? Sorry, this answer is highly unlikely the source of my problem : *Warning*: fclose(): supplied argument is not a valid stream resource in */mnt/169/sda/6/0/ddd321/stt/simpletest/socket.php* on line *255* I think this the problem may be with fopen or something else not allowed to open something in another network etc.. |
From: tamouse m. l. <tam...@gm...> - 2012-11-17 03:27:08
|
On Fri, Nov 16, 2012 at 3:54 AM, kaescrat <kae...@ao...> wrote: > Hi :-) > > I'm trying to get SimpleTest working on a french free ftp provider > (free.fr). It's php 5 (I added a htaccess for that) but I can't get this > to work : Hi, I can't solve your particular issue with free.fr, but I might be able to offer and alternative? What if you set up a local Virtual Machine (using, say Virtual Box) and run the tests against that? That way you can control the entire environment from top to bottom and not incure the possibility of someone hacking your internet site while it's still under development? |
From: kaescrat <kae...@ao...> - 2012-11-16 09:54:58
|
Hi :-) I'm trying to get SimpleTest working on a french free ftp provider (free.fr). It's php 5 (I added a htaccess for that) but I can't get this to work : <?php require_once('simpletest/browser.php'); $browser = &new SimpleBrowser(); $page = $browser->get('http://yahoo.com'); ?> The error is : *Warning*: fclose(): supplied argument is not a valid stream resource in */mnt/169/sda/6/0/ddd321/stt/simpletest/socket.php* on line *255* In advance, thank you very much for your help |
From: Manuel S. <man...@gm...> - 2012-11-08 22:04:05
|
Hi, I have a problem with my mocked objects: The number of calls for class member functions is counted correctly, but SimpleTest (v1.1.0) seems to ignore the expected function arguments. E.g. in this code it does not matter what the url is really like: $mock_http = new MockHttp($settings); $mock_http->returns('download', true); $urls = [ 'http://10.0.0.1:8080/' ]; $mock_http->process($urls); # this calls 'download' internally $expected_urls = [ 'http://10.0.0.1:8080/ FOOOO BAR' ]; $mock_http->expect('download', [$expected_urls]); The it does not matter if $urls == $expected_urls or not. The test always passes. It only fails if I remove the $mock_http->process($urls) call. What am I doing wrong here? Cheers, Manuel |
From: Kevin N. <Cap...@un...> - 2012-10-22 02:37:07
|
Thank you very much, this was a lot of help (and a bit to chew on). I never thought of starting at the acceptance level, but that sounds pretty useful. I'll give that a try. With SimpleTest I assume I can use the "full browser" to actually push the buttons, fill the forms and pull the levers as a real user would to create the acceptance tests? Thanks again, Kevin N. On 10/21/2012 2:42 PM, Noel Darlow wrote: > Hi > >> The concepts I have trouble >> with are primarily around the differences between a unit test and an >> integration test. > A unit test has a tight focus on single "units" of behaviour. As you > put a class through its paces in a series of tests, you'll most likely > be using mocks to represent the object's neighbours. > > An integration test (probably) doesn't use mocks but instead makes > assertions about the behaviour of groups of real objects acting > together. You could mock around the edges of the group though. > > An acceptance test manipulates the user interface and make assertions > about what should happen next. That, I guess, is the ultimate > integration test, where you're testing the entire application, top to > bottom. > > Testing makes most sense working top to bottom ie describe a behaviour > in a (failing) acceptance test and then work your way down through all > the classes you need to make the test pass - test first of course :) > Always code to a failing test. > > In this way testing becomes a design tool. It's a really lovely way to > work. You'll often hear test-infected programmers say "if you > concentrate on writing tests, the code just seems to write itself". The > act of writing a clear test for a single behaviour really helps to > bring the mind into focus. It makes you take decisions. It breaks a > complex task down into lots of little, easy-to-manage steps. If you are > careful always to do the simplest thing to make the test work, it can > lead you off in design directions you might not have thought of. It's a > bit like the process of evolution, lots of little changes guided by > fitness for purpose eventually leading to all kinds of strange beasts > that no-one could have predicted in the beginning. > > Refactoring is an important part of the design process. You need > to go back and review what you've done from time to time, looking for > ways to improve the design. Maybe you can make something simpler > and easier to understand (naming is very important here) or maybe you > want to open up a space to drop in a new behaviour. > > When you're refactoring, unit tests can be a bit of a nuisance, in a > way. Units define very precise behaviours which you are about to change > in the refactoring, and so a whole pile of tests will need to be dumped > or redone. In some ways it's easier to refactor to acceptance tests, > and integration tests because they don't care how about the details of > how things get done, just the results. However, when an acceptance is > failing, it won't be able to explain why, unlike a unit test. > > The main thing I try to do when I'm writing tests is make them read > well, as far as I can like I'm writing a manual for the application. I > will forget how the app works in a few months or so but I'm bound to be > asked to debug a problem or add a new feature somewhere down the line. > Good, easy-to-understand tests let me look up all the behaviours again > and figure out the details of the component parts. > > One of the best things you can do for your code, if you haven't > already, is move object assembly out into a specialist "object graph" > class - ideally a dependency injector like Phemto. Even a custom class, > or classes, with a bunch of manually-written functions which do nothing > but instantiate objects, wire them in to the graph, and return them can > be a big step forward. With good design, this allows you to change > behaviours very easily in the assembler class, simply by dropping a > different object into the graph. In dependency injection, you would > adjust a config file and the injector does all the work for you. > > Sorry I don't have time to look at your code but I'll try to do that > later next week. > > > Noel > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_sfd2d_oct > _______________________________________________ > Simpletest-support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpletest-support |
From: Noel D. <ma...@mc...> - 2012-10-21 18:57:41
|
Hi > The concepts I have trouble > with are primarily around the differences between a unit test and an > integration test. A unit test has a tight focus on single "units" of behaviour. As you put a class through its paces in a series of tests, you'll most likely be using mocks to represent the object's neighbours. An integration test (probably) doesn't use mocks but instead makes assertions about the behaviour of groups of real objects acting together. You could mock around the edges of the group though. An acceptance test manipulates the user interface and make assertions about what should happen next. That, I guess, is the ultimate integration test, where you're testing the entire application, top to bottom. Testing makes most sense working top to bottom ie describe a behaviour in a (failing) acceptance test and then work your way down through all the classes you need to make the test pass - test first of course :) Always code to a failing test. In this way testing becomes a design tool. It's a really lovely way to work. You'll often hear test-infected programmers say "if you concentrate on writing tests, the code just seems to write itself". The act of writing a clear test for a single behaviour really helps to bring the mind into focus. It makes you take decisions. It breaks a complex task down into lots of little, easy-to-manage steps. If you are careful always to do the simplest thing to make the test work, it can lead you off in design directions you might not have thought of. It's a bit like the process of evolution, lots of little changes guided by fitness for purpose eventually leading to all kinds of strange beasts that no-one could have predicted in the beginning. Refactoring is an important part of the design process. You need to go back and review what you've done from time to time, looking for ways to improve the design. Maybe you can make something simpler and easier to understand (naming is very important here) or maybe you want to open up a space to drop in a new behaviour. When you're refactoring, unit tests can be a bit of a nuisance, in a way. Units define very precise behaviours which you are about to change in the refactoring, and so a whole pile of tests will need to be dumped or redone. In some ways it's easier to refactor to acceptance tests, and integration tests because they don't care how about the details of how things get done, just the results. However, when an acceptance is failing, it won't be able to explain why, unlike a unit test. The main thing I try to do when I'm writing tests is make them read well, as far as I can like I'm writing a manual for the application. I will forget how the app works in a few months or so but I'm bound to be asked to debug a problem or add a new feature somewhere down the line. Good, easy-to-understand tests let me look up all the behaviours again and figure out the details of the component parts. One of the best things you can do for your code, if you haven't already, is move object assembly out into a specialist "object graph" class - ideally a dependency injector like Phemto. Even a custom class, or classes, with a bunch of manually-written functions which do nothing but instantiate objects, wire them in to the graph, and return them can be a big step forward. With good design, this allows you to change behaviours very easily in the assembler class, simply by dropping a different object into the graph. In dependency injection, you would adjust a config file and the injector does all the work for you. Sorry I don't have time to look at your code but I'll try to do that later next week. Noel |
From: Kevin N. <Cap...@un...> - 2012-10-18 21:36:39
|
Hi there, I've been playing with simpletest on an open source project to try and learn unit testing (I did something similar with JavaScript recently and that was quite informative). While I was able to get some unit tests going, and they did help tremendously, I am looking to deepen my knowledge of unit tests and of code design in general. Is this an appropriate place to discuss something like that? Here is what I'm using simple test for (there are very few tests in this right now): https://github.com/adcSTUDIO/OnceForm The JS unit tests I did are in this project (I overdid it here, this was literally the first time I ever tried unit testing anything): https://github.com/CaptainN/SignalsLite.js I'm completely self taught, and learned almost completely alone over 12 years from internet searches and books - I'm dying for real critical feedback. If anyone has any pointers for either of those code bases (they are both pretty small), I'd love to hear it - especially as they relate to restructuring code to be more unit test friendly (as is the focus of this list). The concepts I have trouble with are primarily around the differences between a unit test and an integration test. Thanks! Kevin N. |
From: Brian P. <bpa...@gm...> - 2012-10-12 23:45:18
|
Does SimpleTest have the capability to track (and report) the length of time taken for each test? I'm not seeing it in the XML output or in the documentation. -B |
From: <md...@gm...> - 2012-08-05 06:47:31
|
I extend the HtmlReporter, the pass-Message and count is correct, but the error-Message show with line "parent::paintFail($message);" the orignal Error-Output and then my output. But when i remove the line "parent::paintFail($message);" only my error output is visible (thats what i want), but the error-counter show 0 (expected are 2 errors) and pass counter show 4 (expected 2). class ShowPasses extends HtmlReporter { function paintPass($message){ parent::paintPass($message); $this->paintMessage($message, true); } function paintFail($message){ parent::paintFail($message); // <-- Problem here? $this->paintMessage($message, false); } // paintFail function paintMessage($message, $showPass){ // ... output } } |
From: <md...@gm...> - 2012-08-05 06:39:31
|
Thank you, that was the solution. |
From: Roy R. <tch...@gm...> - 2012-08-05 06:37:54
|
There may just be an off-by-one bug to test suites counts. See if that's the case with yours! It has been reported, but probably still exists in some code versions. --- Cell: 585 519 7658 ><> On Aug 5, 2012, at 1:27 AM, md...@gm... wrote: > There are 2 explanations of how to use TestSuites, but the first one executes my tests 2 times > http://simpletest.org/en/group_test_tutorial.html#suite > > The second work fine > http://simpletest.org/en/start-testing.html#group > > Is the documentation not correct or did i understand something wrong? > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Simpletest-support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpletest-support |
From: <md...@gm...> - 2012-08-05 05:27:39
|
There are 2 explanations of how to use TestSuites, but the first one executes my tests 2 times http://simpletest.org/en/group_test_tutorial.html#suite The second work fine http://simpletest.org/en/start-testing.html#group Is the documentation not correct or did i understand something wrong? |
From: Roy R. <tch...@gm...> - 2012-07-11 11:20:17
|
The bug you posted: https://bugs.php.net/bug.php?id=51330 Has an answer that says it's related to the server's keep-alive designation. Perhaps a library that simple test browser uses respects keep-alive. If you can modify that header, that may solve the timeout. --- Cell: 585 519 7658 ><> On Jul 10, 2012, at 10:39 PM, Roger Yarrow <ry...@gm...> wrote: > Additionally, this works. The secret again is that content-length. How > can I make SimpleBrowser complete its transaction once that length is > received rather than hanging? > > $headers = get_headers($url, 1); > $content_length = $headers["Content-Length"]; > $content = file_get_contents($url, NULL, NULL, NULL, $content_length); > echo $content; > die(); > > On Mon, Jul 9, 2012 at 9:46 PM, Roger Yarrow <ry...@gm...> wrote: > >> Hello, >> >> I am attempting to communicate with a web-based RFID door controller. All >> operations via PHP to the unit's IP address hang, but it works in a browser. >> >> When I use SimpleBrowser, it will hang until ConnectionTimeout and then >> work. So it takes 15 seconds (default timeout) to get a response: >> >> echo $browser->get('192.168.1.240'); >> >> This gives me a response back in 1 second. >> >> $browser->setConnectionTimeout(1); >> echo $browser->get('192.168.1.240'); >> >> I am getting all the contents of the page returned, but SimpleBrowser >> isn't happy. It thinks everything is failing and I can't proceed: >> >> getURL() = http://192.168.1.240/ACT_ID_1 >> getHeaders() = POST /ACT_ID_1 HTTP/1.0 >> Host: 192.168.1.240 >> Connection: close >> Content-Length: 43 >> Content-Type: application/x-www-form-urlencoded >> username=abc&pwd=123&logId=20090416 >> getTransportError() = Nothing fetched >> getResponseCode() = 0 >> >> So, the timeout gets triggered, and I get a response finally but it assume >> failure. >> >> I determined it was content-length related due to this post I found at >> https://bugs.php.net/bug.php?id=51330 >> >> This operation hangs forever: >> >> $content = file_get_contents('http://192.168.1.240'); >> >> But this one returns immediately because I give it a maximum length of >> content to expect: >> >> $content = file_get_contents('http://192.168.1.240/', NULL, NULL, 0, >> 1000); >> >> Is there a way/fix to set SimpleBrowser to respond/react appropriately and >> not hang/timeout? Like a header or something I can set? >> >> Thanks, >> Roger >> > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Simpletest-support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpletest-support |
From: tamouse m. l. <tam...@gm...> - 2012-07-11 06:20:42
|
This is just a random guess, but it sounds like whatever you're querying isn't sending a termination. On Tue, Jul 10, 2012 at 9:39 PM, Roger Yarrow <ry...@gm...> wrote: > Additionally, this works. The secret again is that content-length. How > can I make SimpleBrowser complete its transaction once that length is > received rather than hanging? > > $headers = get_headers($url, 1); > $content_length = $headers["Content-Length"]; > $content = file_get_contents($url, NULL, NULL, NULL, $content_length); > echo $content; > die(); > > On Mon, Jul 9, 2012 at 9:46 PM, Roger Yarrow <ry...@gm...> wrote: > >> Hello, >> >> I am attempting to communicate with a web-based RFID door controller. All >> operations via PHP to the unit's IP address hang, but it works in a browser. >> >> When I use SimpleBrowser, it will hang until ConnectionTimeout and then >> work. So it takes 15 seconds (default timeout) to get a response: >> >> echo $browser->get('192.168.1.240'); >> >> This gives me a response back in 1 second. >> >> $browser->setConnectionTimeout(1); >> echo $browser->get('192.168.1.240'); >> >> I am getting all the contents of the page returned, but SimpleBrowser >> isn't happy. It thinks everything is failing and I can't proceed: >> >> getURL() = http://192.168.1.240/ACT_ID_1 >> getHeaders() = POST /ACT_ID_1 HTTP/1.0 >> Host: 192.168.1.240 >> Connection: close >> Content-Length: 43 >> Content-Type: application/x-www-form-urlencoded >> username=abc&pwd=123&logId=20090416 >> getTransportError() = Nothing fetched >> getResponseCode() = 0 >> >> So, the timeout gets triggered, and I get a response finally but it assume >> failure. >> >> I determined it was content-length related due to this post I found at >> https://bugs.php.net/bug.php?id=51330 >> >> This operation hangs forever: >> >> $content = file_get_contents('http://192.168.1.240'); >> >> But this one returns immediately because I give it a maximum length of >> content to expect: >> >> $content = file_get_contents('http://192.168.1.240/', NULL, NULL, 0, >> 1000); >> >> Is there a way/fix to set SimpleBrowser to respond/react appropriately and >> not hang/timeout? Like a header or something I can set? >> >> Thanks, >> Roger >> > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Simpletest-support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpletest-support |
From: Roger Y. <ry...@gm...> - 2012-07-11 02:40:00
|
Additionally, this works. The secret again is that content-length. How can I make SimpleBrowser complete its transaction once that length is received rather than hanging? $headers = get_headers($url, 1); $content_length = $headers["Content-Length"]; $content = file_get_contents($url, NULL, NULL, NULL, $content_length); echo $content; die(); On Mon, Jul 9, 2012 at 9:46 PM, Roger Yarrow <ry...@gm...> wrote: > Hello, > > I am attempting to communicate with a web-based RFID door controller. All > operations via PHP to the unit's IP address hang, but it works in a browser. > > When I use SimpleBrowser, it will hang until ConnectionTimeout and then > work. So it takes 15 seconds (default timeout) to get a response: > > echo $browser->get('192.168.1.240'); > > This gives me a response back in 1 second. > > $browser->setConnectionTimeout(1); > echo $browser->get('192.168.1.240'); > > I am getting all the contents of the page returned, but SimpleBrowser > isn't happy. It thinks everything is failing and I can't proceed: > > getURL() = http://192.168.1.240/ACT_ID_1 > getHeaders() = POST /ACT_ID_1 HTTP/1.0 > Host: 192.168.1.240 > Connection: close > Content-Length: 43 > Content-Type: application/x-www-form-urlencoded > username=abc&pwd=123&logId=20090416 > getTransportError() = Nothing fetched > getResponseCode() = 0 > > So, the timeout gets triggered, and I get a response finally but it assume > failure. > > I determined it was content-length related due to this post I found at > https://bugs.php.net/bug.php?id=51330 > > This operation hangs forever: > > $content = file_get_contents('http://192.168.1.240'); > > But this one returns immediately because I give it a maximum length of > content to expect: > > $content = file_get_contents('http://192.168.1.240/', NULL, NULL, 0, > 1000); > > Is there a way/fix to set SimpleBrowser to respond/react appropriately and > not hang/timeout? Like a header or something I can set? > > Thanks, > Roger > |
From: Roy R. <tch...@gm...> - 2012-07-10 17:40:17
|
Hi All, I use html5, and the simpletest browser simply drops the new html5 form input types (e.g. email, number, etc). I tried adding them to the tags code, but that didn't seem to have any effect. Does anyone know of a workaround for working with html5 <input type=email>, <input type=number>, etc? Thanks, --Roy -- +++++++++++++++++++++++++++ BitLucid.com <http://bitlucid.com/> - BitLucid, Inc. - Web & Programming Consultants ninjawars.net - My webgame project 585-519-7658 - Cell "Never compare your inside with somebody's outside." |
From: Roger Y. <ry...@gm...> - 2012-07-10 01:46:33
|
Hello, I am attempting to communicate with a web-based RFID door controller. All operations via PHP to the unit's IP address hang, but it works in a browser. When I use SimpleBrowser, it will hang until ConnectionTimeout and then work. So it takes 15 seconds (default timeout) to get a response: echo $browser->get('192.168.1.240'); This gives me a response back in 1 second. $browser->setConnectionTimeout(1); echo $browser->get('192.168.1.240'); I am getting all the contents of the page returned, but SimpleBrowser isn't happy. It thinks everything is failing and I can't proceed: getURL() = http://192.168.1.240/ACT_ID_1 getHeaders() = POST /ACT_ID_1 HTTP/1.0 Host: 192.168.1.240 Connection: close Content-Length: 43 Content-Type: application/x-www-form-urlencoded username=abc&pwd=123&logId=20090416 getTransportError() = Nothing fetched getResponseCode() = 0 So, the timeout gets triggered, and I get a response finally but it assume failure. I determined it was content-length related due to this post I found at https://bugs.php.net/bug.php?id=51330 This operation hangs forever: $content = file_get_contents('http://192.168.1.240'); But this one returns immediately because I give it a maximum length of content to expect: $content = file_get_contents('http://192.168.1.240/', NULL, NULL, 0, 1000); Is there a way/fix to set SimpleBrowser to respond/react appropriately and not hang/timeout? Like a header or something I can set? Thanks, Roger |
From: Manuel V. <man...@gm...> - 2012-06-22 11:29:23
|
Hi, Any help on that? I'm willing to fix it by myself but I'd like to have an hint on where to start. Thanks, Manuel On Sun, Jun 10, 2012 at 7:14 PM, Manuel Vacelet <man...@gm...>wrote: > Hi there, > > I try to update to latest simpletest version (1.0.1 -> 1.1) and I'm facing > some issues with object comparison. > Xdebug catch an infinite loop when comparing nested objects. > > Can you help me? > > I tested with both php5.3.10 and php 5.1.6 (the same code works with > simpletest1.0.1) > > class Foo { > function doFooStuff($bar) { > } > } > > class Bar { > private $foo; > > public function __construct($foo) { > $this->foo = $foo; > } > > function doBarStuff() { > $this->foo->doFooStuff($this); > } > } > > class FooBarTest extends UnitTestCase { > > public function testFooBar() { > Mock::generate('Foo'); > $foo = new MockFoo(); > $bar = new Bar($foo); > $foo->expectOnce('doFooStuff', array($bar)); > $bar->doBarStuff(); > } > } > > PHP Fatal error: Maximum function nesting level of '100' reached, > aborting! in /path/to/simpletest/compatibility.php on line 85 > PHP Stack trace: > PHP 1. simpletest_autorun() /path/to/simpletest/autorun.php:0 > PHP 2. run_local_tests() /path/to/simpletest/autorun.php:30 > PHP 3. TestSuite->run() /path/to/simpletest/autorun.php:54 > PHP 4. SimpleTestCase->run() /path/to/simpletest/test_case.php:560 > PHP 5. SimpleErrorTrappingInvoker->invoke() > /path/to/simpletest/test_case.php:144 > PHP 6. SimpleInvokerDecorator->invoke() /path/to/simpletest/errors.php:42 > PHP 7. SimpleExceptionTrappingInvoker->invoke() > /path/to/simpletest/invoker.php:126 > PHP 8. SimpleInvokerDecorator->invoke() > /path/to/simpletest/exceptions.php:43 > PHP 9. SimpleInvoker->invoke() /path/to/simpletest/invoker.php:126 > PHP 10. FooBarTest->testFooBar() /path/to/simpletest/invoker.php:68 > PHP 11. Bar->doBarStuff() /path/foo.php:28 > PHP 12. MockFoo->doFooStuff() /path/foo.php:17 > PHP 13. SimpleMock->invoke() /path/to/simpletest/mock_objects.php(1314) : > eval()'d code:187 > PHP 14. SimpleMock->checkExpectations() > /path/to/simpletest/mock_objects.php:1112 > PHP 15. SimpleTestCase->assert() /path/to/simpletest/mock_objects.php:1161 > PHP 16. ParametersExpectation->test() > /path/to/simpletest/test_case.php:313 > PHP 17. ParametersExpectation->testParameter() > /path/to/simpletest/mock_objects.php:59 > PHP 18. IdenticalExpectation->test() > /path/to/simpletest/mock_objects.php:75 > PHP 19. SimpleTestCompatibility::isIdentical() > /path/to/simpletest/expectation.php:542 > PHP 20. SimpleTestCompatibility::isIdenticalType() > /path/to/simpletest/compatibility.php:40 > PHP 21. SimpleTestCompatibility::isArrayOfIdenticalTypes() > /path/to/simpletest/compatibility.php:66 > PHP 22. SimpleTestCompatibility::isIdenticalType() > /path/to/simpletest/compatibility.php:91 > PHP 23. SimpleTestCompatibility::isArrayOfIdenticalTypes() > /path/to/simpletest/compatibility.php:66 > PHP 24. SimpleTestCompatibility::isIdenticalType() > /path/to/simpletest/compatibility.php:91 > PHP 25. SimpleTestCompatibility::isArrayOfIdenticalTypes() > /path/to/simpletest/compatibility.php:66 > PHP 26. SimpleTestCompatibility::isIdenticalType() > /path/to/simpletest/compatibility.php:91 > PHP 27. SimpleTestCompatibility::isArrayOfIdenticalTypes() > /path/to/simpletest/compatibility.php:66 > PHP 28. SimpleTestCompatibility::isIdenticalType() > /path/to/simpletest/compatibility.php:91 > PHP 29. SimpleTestCompatibility::isArrayOfIdenticalTypes() > /path/to/simpletest/compatibility.php:69 > PHP 30. SimpleTestCompatibility::isIdenticalType() > /path/to/simpletest/compatibility.php:91 > .... > > -- > Twitter: @vaceletm > -- Twitter: @vaceletm |
From: Tim <da...@fa...> - 2012-06-22 08:01:25
|
so it seems the '=' chars are being stripped off by mergeAttributes() in the tidy_parser.php. However the unaffected machines never seem to take this code-path. On 22/06/12 11:44, Tim wrote: > Hi, > So I have been having trouble getting a login working using the the > browser module, this is only happening on one particular server which is > RHEL6 w/ php 5.3.13. > > Basically the login fails, with the remote server rejecting the request. > On closer inspection, the post parameters appear to be truncated. i.e > there is a validation key that should be > > "/wEWBgKg39dCAtHo2bAJAoCO7/gFAraE6F8CoejZkAICz5yEggoKjWoDPyV4u4qbEbtGzIJvWG8IkA==" > > > but simpletest appears to be sending the following in the post instead > > > ""/wEWBgKg39dCAtHo2bAJAoCO7/gFAraE6F8CoejZkAICz5yEggoKjWoDPyV4u4qbEbtGzIJvWG8IkA" > > > > Any thoughts on what is causing this? > > Thanks > Tim > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Simpletest-support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpletest-support |