<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent changes to support-requests</title><link href="https://sourceforge.net/p/simpletest/support-requests/" rel="alternate"/><link href="https://sourceforge.net/p/simpletest/support-requests/feed.atom" rel="self"/><id>https://sourceforge.net/p/simpletest/support-requests/</id><updated>2012-09-13T07:44:24Z</updated><subtitle>Recent changes to support-requests</subtitle><entry><title>GET request after POST</title><link href="https://sourceforge.net/p/simpletest/support-requests/21/" rel="alternate"/><published>2012-09-13T07:44:24Z</published><updated>2012-09-13T07:44:24Z</updated><author><name>Anonymous</name><uri>https://sourceforge.net/u/userid-None/</uri></author><id>https://sourceforge.netd7c977c5e1eabf7280c5e40f5db803595bc84180</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I'm submitting a form that does a POST then a redirect with a GET request. &lt;br /&gt;
If I do:&lt;br /&gt;
$browser-&amp;gt;getRequest();&lt;br /&gt;
It gives me the data of the last GET request.&lt;br /&gt;
How can I fetch the request data of the POST ?&lt;br /&gt;
Thank you&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>do you support socks?</title><link href="https://sourceforge.net/p/simpletest/support-requests/20/" rel="alternate"/><published>2009-06-27T07:45:45Z</published><updated>2009-06-27T07:45:45Z</updated><author><name>ivelon angelo</name><uri>https://sourceforge.net/u/post2web/</uri></author><id>https://sourceforge.net206fa8bbc4f9ce35dbfa3548bff12a0753e6fe88</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Is there any way to use the browser class with socks4 / socks5?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>submitFormByID - fetch the next page</title><link href="https://sourceforge.net/p/simpletest/support-requests/19/" rel="alternate"/><published>2009-04-22T05:37:55Z</published><updated>2009-04-22T05:37:55Z</updated><author><name>Daryle Dakis</name><uri>https://sourceforge.net/u/crashhh/</uri></author><id>https://sourceforge.net1f4a6513795889ed21e97eb4db2c0bf0044c6ac7</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello. I am trying to automate our website registration and I need some help regarding fetching the next page after submitting the form. Here's the situation:&lt;/p&gt;
&lt;p&gt;registration page: &lt;a href="http://localhost/unit_testing/accounts/register" rel="nofollow"&gt;http://localhost/unit_testing/accounts/register&lt;/a&gt;&lt;br /&gt;
method=POST; action=same URL as above but with different contents if the registration is successful.&lt;/p&gt;
&lt;p&gt;So after filling up all the required fields (using simpletest of course) and submitting the form, is there a way to fetch the succeeding page automatically? I have done this but failed, and got the main registration page, despite the fact that the registration is successful. Here's my code:&lt;/p&gt;
&lt;p&gt;$some_textbox_variable = 'some textbox values';&lt;/p&gt;
&lt;p&gt;$this-&amp;gt;get('http://localhost/unit_testing/accounts/register');&lt;/p&gt;
&lt;p&gt;if ($this-&amp;gt;assertText('some registration page text'))&lt;br /&gt;
{&lt;br /&gt;
$this-&amp;gt;assertTrue($this-&amp;gt;setFieldbyName('some_textbox_name', $some_textbox_variable));&lt;/p&gt;
&lt;p&gt;$this-&amp;gt;assertTrue($this-&amp;gt;submitFormById('RegisterForm'));&lt;br /&gt;
$this-&amp;gt;getUrl();&lt;/p&gt;
&lt;p&gt;if ($this-&amp;gt;assertText('Registered')) //'Registered' is a text displayed if the registration is successful.&lt;br /&gt;
{ echo '&amp;lt;br&amp;gt; Success &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;';}&lt;br /&gt;
else&lt;br /&gt;
{echo '&amp;lt;br&amp;gt; Error &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;';}&lt;br /&gt;
;&lt;br /&gt;
;&lt;br /&gt;
}&lt;br /&gt;
;&lt;/p&gt;
&lt;p&gt;And when I replace $this-&amp;gt;getUrl(); with $this-&amp;gt;get('http://localhost/unit_testing/accounts/register, it fetches the main registration page and not the "registration complete" page (again, both are under the same URL).&lt;/p&gt;
&lt;p&gt;I hope somehow I made myself clear. Any help would be appreciated. Thank you.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>add a SimpleStackTrace::_skipFrame() method?</title><link href="https://sourceforge.net/p/simpletest/support-requests/18/" rel="alternate"/><published>2008-04-17T17:05:16Z</published><updated>2008-04-17T17:05:16Z</updated><author><name>Noel Darlow</name><uri>https://sourceforge.net/u/mgruff/</uri></author><id>https://sourceforge.net5612c5f2906ff2faccf9facfe7496cebc3abaa6c</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;another newly-private property: SimpleStackTrace::$_prefixes. &lt;/p&gt;
&lt;p&gt;Because I build all my tests on a customised UnitTestCase class, I need to tweak SimpleStackTrace::traceMethod so that it doesn't stick on the wrong frame.&lt;/p&gt;
&lt;p&gt;class AperiStackTrace extends SimpleStackTrace {&lt;/p&gt;
&lt;p&gt;function __construct($prefixes) {&lt;br /&gt;
$this-&amp;gt;_prefixes = $prefixes;&lt;br /&gt;
}&lt;br /&gt;
function traceMethod($stack = false) {&lt;br /&gt;
$stack = ...;&lt;br /&gt;
foreach ($stack as $frame) {&lt;br /&gt;
if ($this-&amp;gt;_frameLiesWithinSimpleTestFolder($frame)) {&lt;br /&gt;
continue;&lt;br /&gt;
}&lt;br /&gt;
if(array_key_exists('file', $frame) &lt;br /&gt;
and preg_match(&lt;br /&gt;
'/AperiTestCase/', &lt;br /&gt;
$frame['file'])) { &lt;br /&gt;
continue;&lt;br /&gt;
}&lt;br /&gt;
if ($this-&amp;gt;_frameMatchesPrefix($frame)) {&lt;br /&gt;
...&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
return '';&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
Simply renaming the current "SimpleStackTrace" constructor to a php5 "__constructor" would, I think, fix this (and dump the AperiTestCase constructor, obviously).&lt;/p&gt;
&lt;p&gt;However, I'd expect that using a customised UnitTestCase could be quite common amongst users, and so others might need the same stack trace tweak. &lt;/p&gt;
&lt;p&gt;If so, what about a skipFrame() method?&lt;/p&gt;
&lt;p&gt;class SimpleStackTrace {&lt;/p&gt;
&lt;p&gt;function traceMethod($stack = false) {&lt;br /&gt;
$stack = ...;&lt;br /&gt;
foreach ($stack as $frame) {&lt;br /&gt;
if ($this-&amp;gt;_frameLiesWithinSimpleTestFolder($frame)) {&lt;br /&gt;
continue;&lt;br /&gt;
}&lt;br /&gt;
if($this-&amp;gt;_skipFrame($frame)) { &lt;br /&gt;
continue;&lt;br /&gt;
}&lt;br /&gt;
if ($this-&amp;gt;_frameMatchesPrefix($frame)) {&lt;br /&gt;
...&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
return '';&lt;br /&gt;
}&lt;br /&gt;
function _skipframe($frame) {&lt;br /&gt;
return false;&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;Now users only need to implement _skipFrame in the derived class rather than copy-paste the whole of  traceMethod() just to insert that little piece of logic.&lt;/p&gt;
&lt;p&gt;Noel&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>remove static from SimpleDumper::dump()</title><link href="https://sourceforge.net/p/simpletest/support-requests/17/" rel="alternate"/><published>2008-04-17T16:58:43Z</published><updated>2008-04-17T16:58:43Z</updated><author><name>Noel Darlow</name><uri>https://sourceforge.net/u/mgruff/</uri></author><id>https://sourceforge.net6308841886823572ad2ab9a2a3a14a47377b2e44</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;This breaks a test where I've mocked SimpleDumper:&lt;/p&gt;
&lt;p&gt;"Fatal error: Using $this when not in object context&lt;br /&gt;
in /var/www/localhost/htdocs/simpletest-svn/simpletest/mock_objects.php(1305) :&lt;br /&gt;
eval()'d code on line 230&lt;/p&gt;
&lt;p&gt;The offending (generated) code:&lt;/p&gt;
&lt;p&gt;class MockSimpleDumper extends SimpleDumper {&lt;br /&gt;
...&lt;br /&gt;
...&lt;/p&gt;
&lt;p&gt;static function dump($variable) {&lt;br /&gt;
$args = func_get_args();&lt;br /&gt;
$result = &amp;amp;$this-&amp;gt;_mock-&amp;gt;_invoke("dump", $args);&lt;br /&gt;
return $result;&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;Easy fix:&lt;/p&gt;
&lt;p&gt;--- simpletest-svn/simpletest/dumper.php   (revision 1764)&lt;br /&gt;
+++ simpletest-svn/simpletest/dumper.php    (working copy)&lt;br /&gt;
@@ -348,7 +348,7 @@&lt;br /&gt;
*    @return string            Output from print_r().&lt;br /&gt;
*    @access public&lt;br /&gt;
*/&lt;br /&gt;
-    static function dump($variable) {&lt;br /&gt;
+    function dump($variable) {&lt;br /&gt;
ob_start();&lt;br /&gt;
print_r($variable);&lt;br /&gt;
$formatted = ob_get_contents();&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>$_should_skip accessor</title><link href="https://sourceforge.net/p/simpletest/support-requests/16/" rel="alternate"/><published>2008-04-17T16:54:33Z</published><updated>2008-04-17T16:54:33Z</updated><author><name>Noel Darlow</name><uri>https://sourceforge.net/u/mgruff/</uri></author><id>https://sourceforge.netf0bb32325e2b50592d1b6f10786b1f86f64b42fa</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;As discussed on the mailing list, I have an AperiTestCase which extends UnitTestCase. The former overrides UnitTestCase::run(). Recently UnitTestCase::$_should_skip was made private and hence is not visible to my derived class. Following solves my problems for me and doesn't break any SimpleTest tests AFAIK:&lt;/p&gt;
&lt;p&gt;--- simpletest-svn/simpletest/test_case.php   (revision 1764)&lt;br /&gt;
+++ simpletest-svn/simpletest/test_case.php    (working copy)&lt;br /&gt;
@@ -96,6 +96,9 @@&lt;br /&gt;
function skipUnless($shouldnt_skip, $message = false) {&lt;br /&gt;
$this-&amp;gt;skipIf(! $shouldnt_skip, $message);&lt;br /&gt;
}&lt;br /&gt;
+    function _shouldSkip() {&lt;br /&gt;
+        return $this-&amp;gt;_should_skip;&lt;br /&gt;
+    }&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>&lt;input type='image' not supported</title><link href="https://sourceforge.net/p/simpletest/support-requests/15/" rel="alternate"/><published>2007-09-07T12:18:00Z</published><updated>2007-09-07T12:18:00Z</updated><author><name>Anonymous</name><uri>https://sourceforge.net/u/userid-None/</uri></author><id>https://sourceforge.net5528d0ccaa76c4e52359384e1e7889917a994e15</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;To make my website prettier, I replaced&lt;br /&gt;
&amp;lt;input type='submit' name='xyz' ... &lt;br /&gt;
by&lt;br /&gt;
&amp;lt;input type='image' name='xyz'...&lt;/p&gt;
&lt;p&gt;This causes all my unittests to fail, because the image button is not treated as a submit button by SimpleTest.&lt;/p&gt;
&lt;p&gt;As a temporary fix, I changed SimpleTest sourcecode:&lt;/p&gt;
&lt;p&gt;form.php, line 147:&lt;/p&gt;
&lt;p&gt;function addWidget(&amp;amp;$tag) {&lt;br /&gt;
if (strtolower($tag-&amp;gt;getAttribute('type')) == 'submit') {&lt;br /&gt;
$this-&amp;gt;_buttons[] = &amp;amp;$tag;&lt;br /&gt;
} elseif (strtolower($tag-&amp;gt;getAttribute('type')) == 'image') {&lt;br /&gt;
$this-&amp;gt;_images[] = &amp;amp;$tag;&lt;br /&gt;
$this-&amp;gt;_buttons[] = &amp;amp;$tag;   // new JBR&lt;br /&gt;
} elseif ($tag-&amp;gt;getName()) {&lt;br /&gt;
$this-&amp;gt;_setWidget($tag);&lt;br /&gt;
}&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;page.php, line 86:&lt;/p&gt;
&lt;p&gt;function _createInputTag($attributes) {&lt;br /&gt;
if (! isset($attributes['type'])) {&lt;br /&gt;
return new SimpleTextTag($attributes);&lt;br /&gt;
}&lt;br /&gt;
$type = strtolower(trim($attributes['type']));&lt;br /&gt;
$map = array(&lt;br /&gt;
'submit' =&amp;gt; 'SimpleSubmitTag',&lt;br /&gt;
'image' =&amp;gt; 'SimpleSubmitTag',  // added by JBR&lt;br /&gt;
//'image' =&amp;gt; 'SimpleImageSubmitTag',&lt;br /&gt;
'checkbox' =&amp;gt; 'SimpleCheckboxTag',&lt;/p&gt;
&lt;p&gt;...&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;
&lt;p&gt;jan&lt;/p&gt;
&lt;p&gt;jbr1963@telenet.be&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>setField() returns false while field exists</title><link href="https://sourceforge.net/p/simpletest/support-requests/14/" rel="alternate"/><published>2007-02-14T05:24:16Z</published><updated>2007-02-14T05:24:16Z</updated><author><name>Gardner Bickford</name><uri>https://sourceforge.net/u/gbickford/</uri></author><id>https://sourceforge.netd5ebecd4cc9f4d3b2bb12f68d1030c64386f9c09</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello,&lt;br /&gt;
I am evaluating SimpleTest for use with our site. Everything looks great except for WebTestCase which gave me a fatal error in the bet tar ball. The CVS code works kinda:&lt;/p&gt;
&lt;p&gt;I am filling out a registration form which contains &amp;lt;select&amp;gt; tags. It seems that the setField() does not fill out the &amp;lt;select&amp;gt; fields of the form.&lt;/p&gt;
&lt;p&gt;I have prepared some sample code (17 lines) and attached it to this . Please keep in mind that I am using:&lt;br /&gt;
PHP 4.4.4 (cli) (built: Nov  1 2006 18:12:33)&lt;br /&gt;
Copyright (c) 1997-2006 The PHP Group&lt;br /&gt;
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Funny with the Eclipse Plugin.</title><link href="https://sourceforge.net/p/simpletest/support-requests/13/" rel="alternate"/><published>2007-01-13T00:49:49Z</published><updated>2007-01-13T00:49:49Z</updated><author><name>Gavin Bravery</name><uri>https://sourceforge.net/u/misterb/</uri></author><id>https://sourceforge.neta27ed08bdc927acefcaf58a7514c5ddad263f15f</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I'm just playing around with this (it's a good piece of code BTW).&lt;/p&gt;
&lt;p&gt;I've found a slight niggle... wondered if I was doing something stupid.&lt;/p&gt;
&lt;p&gt;If I have a script that starts like this:&lt;/p&gt;
&lt;p&gt;&amp;lt;?php&lt;br /&gt;
if (! defined('SIMPLE_TEST')) {&lt;br /&gt;
define('SIMPLE_TEST', 'simpletest/');&lt;br /&gt;
}&lt;br /&gt;
require_once(SIMPLE_TEST . 'unit_tester.php');&lt;br /&gt;
require_once(SIMPLE_TEST . 'reporter.php');&lt;/p&gt;
&lt;p&gt;require_once('../classes/log.php');&lt;/p&gt;
&lt;p&gt;The plugin tells me that it can't find log.php&lt;br /&gt;
However, the script runs fine when I run it as a PHP script.&lt;/p&gt;
&lt;p&gt;However, if I use this:&lt;/p&gt;
&lt;p&gt;&amp;lt;?php&lt;br /&gt;
if (! defined('SIMPLE_TEST')) {&lt;br /&gt;
define('SIMPLE_TEST', 'simpletest/');&lt;br /&gt;
}&lt;br /&gt;
require_once(SIMPLE_TEST . 'unit_tester.php');&lt;br /&gt;
require_once(SIMPLE_TEST . 'reporter.php');&lt;/p&gt;
&lt;p&gt;require_once('C:\PHP Training\LastCraft\classes\log.php');&lt;/p&gt;
&lt;p&gt;The plugin works fine...&lt;/p&gt;
&lt;p&gt;Am I doing something stupid? Or do i have to define my includes with full paths, rather than relative ones?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Gavin&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>main(eclipse.php): failed to open stream</title><link href="https://sourceforge.net/p/simpletest/support-requests/12/" rel="alternate"/><published>2006-11-06T17:24:57Z</published><updated>2006-11-06T17:24:57Z</updated><author><name>Petr `PePa` Pavel</name><uri>https://sourceforge.net/u/xpavp03/</uri></author><id>https://sourceforge.netc727b70f6e7092c0e9f4e1840a18d02df5f2cc53</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi there.&lt;br /&gt;
I followed the instructions in readme.html to create a&lt;br /&gt;
Single Passing Test.&lt;br /&gt;
I wasn't able to use Package Explorer to add project&lt;br /&gt;
and files but I used Navigator instead. (Eclipse 3.2.0)&lt;br /&gt;
I too don't have project group called "Simple" - only&lt;br /&gt;
one called "General" but I don't think it matters.&lt;br /&gt;
(This is a reference to another support request I found&lt;br /&gt;
here.)&lt;/p&gt;
&lt;p&gt;I was able to run the test but SimpleTest Result View&lt;br /&gt;
says Runs 0/0 Failures 0 Errors 0 and Console gives me&lt;br /&gt;
the message you'll find at the end of my post.&lt;/p&gt;
&lt;p&gt;I couldn't find eclipse.php in neither&lt;br /&gt;
simpletest_1.0.1beta.eclipse_0.1.9.zip nor&lt;br /&gt;
simpletest_1.0.1alpha3.tar.gz. I did try to find the&lt;br /&gt;
solution to my problem via Google but I failed.&lt;br /&gt;
Can someone please tell me what am I doing wrong?&lt;/p&gt;
&lt;p&gt;To start with I had to install the plugin manually&lt;br /&gt;
because the procedure described in readme.html didn't&lt;br /&gt;
work for me. I don't think it relates to my problem but&lt;br /&gt;
one never knows.&lt;/p&gt;
&lt;p&gt;Thanks&lt;br /&gt;
Petr 'PePa' Pavel&lt;/p&gt;
&lt;p&gt;Running: &lt;br /&gt;
echo "&amp;lt;?php&lt;br /&gt;
$path='S:\simpletest';ini_set('include_path',&lt;br /&gt;
get_include_path().PATH_SEPARATOR .&lt;br /&gt;
realpath($path));$fullpath = realpath('C:/Program&lt;br /&gt;
Files/Apache&lt;br /&gt;
Group/Apache2/htdocs/Test/test1.php');$pathparts =&lt;br /&gt;
pathinfo($fullpath);$filename =&lt;br /&gt;
$pathparts['basename'];include_once('xml.php');include_once('unit_tester.php');include_once('mock_objects.php');include_once('test_case.php');include_once('invoker.php');$test=new&lt;br /&gt;
GroupTest($filename);$test-&amp;gt;addTestFile($fullpath);$test-&amp;gt;run(new&lt;br /&gt;
XmlReporter()); ?&amp;gt;" | "C:\Program Files\Apache&lt;br /&gt;
Group\PHP\php\php.exe" -q -c "C:\WINDOWS\php.ini"&lt;br /&gt;
*************&lt;br /&gt;
Process returned: 255&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Warning&amp;lt;/b&amp;gt;:  main(eclipse.php): failed to open&lt;br /&gt;
stream: No such file or directory in &amp;lt;b&amp;gt;C:\Program&lt;br /&gt;
Files\Eclipse3.2\-&amp;lt;/b&amp;gt; on line &amp;lt;b&amp;gt;1&amp;lt;/b&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Warning&amp;lt;/b&amp;gt;:  main(): Failed opening 'eclipse.php'&lt;br /&gt;
for inclusion (include_path='.;C:\Program Files\Apache&lt;br /&gt;
Group\PHP\includes\pear;S:\simpletest') in&lt;br /&gt;
&amp;lt;b&amp;gt;C:\Program Files\Eclipse3.2\-&amp;lt;/b&amp;gt; on line &amp;lt;b&amp;gt;1&amp;lt;/b&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Fatal error&amp;lt;/b&amp;gt;:  Cannot instantiate non-existent&lt;br /&gt;
class:  grouptest in &amp;lt;b&amp;gt;C:\Program&lt;br /&gt;
Files\Eclipse3.2\-&amp;lt;/b&amp;gt; on line &amp;lt;b&amp;gt;1&amp;lt;/b&amp;gt;&amp;lt;br /&amp;gt;&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>