Mark Donohoe | 18 Aug 22:26

Using test libraries/classes

Hello,

Have been using ST for about 2-3 months now.  Like it lot, well except for the 
documentation... a great start but then.....I'd like to help fix some of that...

Here is the problem of the week.  I'm sorta new to OO as well, so it could be 
that and not ST.

I'm trying to use Jason's suggestion to extend WebTestCase with my own project 
specific class.  So far so good.  But now my fossologyWebTestCase class is 
getting big with more methods than I want.  I tried to refactor but could not 
get things to work that way....

Specifics I tried:

class fossologyWebTestCase extends WebTestCase {

    function uploadAFile(....) { ... }
    function browseMiniMenu(...) { ....}
    etc....
}

What I would like to do is create a number of 'utility' test classes that can be 
used by the basic unit tests as well as for other higher level functional and 
stress testing.

I tried to factor our things like uploads to an upload class, browse to a browse 
class etc...

I tried
(Continue reading)

marie | 31 Jul 14:54

selenium extension

Hi,

I've just seen that in its svn version, simpletest has selenium 
extensions.
Is there a documentation or a tutorial for using it ? I didn't find it yet 
:-(

I tryed like that:

class SeleniumTest_Start extends SeleniumTestCase
{

  private $urlBase;

  function SeleniumTest_Start($name="Start")
  {
        try {
                $this->verificationErrors = array();
                $this->host        = $_SERVER['HTTP_HOST'];
                $this->urlBase = "http://".$this
->host.HttpRequest::getPathUrl();
                $this->setBrowser("*chrome");
                $this->setBrowserUrl($this->urlBase);
                $this->start();
                $this->open($this->urlBase."/index.php");
        }
        catch (RuntimeException $re){
                $this->stop();
        }
  }
(Continue reading)

Elijah Insua | 1 Aug 13:05

Blerby Test Runner

Hey guys,

I have just released version 0.6 the ajax test runner.  It now includes 
some of the tests taken from the test directory in simpletest as 
"examples" and also a PHPUnit example.  There have been a few bug fixes 
and functionality improvements since 0.5.  You can find more information 
here: http://www.blerby.com/project/testrunner/documentation/

Feel free to have a look and give me feedback!

Thanks
-- Elijah

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
Mark Donohoe | 30 Jul 17:38

Sessions and simpletest

Folks,

Just starting to get into simpletest and web testing.. I am having problems 
after testing a login.  The login works fine, but right after that I'm logged 
out....  Our login process sets the name with session_name and then does a 
session_start.

I posted to sitepoint, got one reply.  They thought that simpletest clears 
session data on start, but wasnt' sure.

I haven't found anything in the docs on this.  Still looking.

So what does simpletest do with sessions?

Rather than repeat everything here, see the sitepoint listing.

http://www.sitepoint.com/forums/showthread.php?t=562695

Thanks for your help.
--

-- 
Mark Donohoe
OSLO/OSTT, Cupertino CA.
fossology.org

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
(Continue reading)

Peter Kehl | 29 Jul 20:14

How to invoke a chosen test function

Hello,

my PHP project has one long test class, a child of UnitTestCase.
Running it takes quite long. That's OK when I run it to detect any
failures. But when I try to fix my project and I re-run the test, I
have to wait for it all to run. I know I can split it into groups or
what have you, but I don't want to reorganize the groups everytime
some test function fails.

Is there a way to invoke just a specific test function from within
that class? If not, what would you suggest? I've looked into
SimpleTest API and I'm confused where to start.

Best regards,
- Peter Kehl

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
Zack Wickes | 25 Jul 18:53

sample reporter scripts

Anyone have some sample customized HtmlReporter scripts to share?  I would
like more (albeit generic) output from the reporter and before I write it
myself I thought I would ask.

Thanks.

Zack.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
kailash vyas | 24 Jul 22:45

problem with simpletest on prepend

Hi Marcus,

I had problems working with simpletest when there is a php file in
auto_prepend_file in php.ini
if there is a file in auto_prepend_file then it gives this error

Fail: -> Bad TestSuite [prepend.php] with error [No runnable test cases in
[prepend.php]]

where prepend.php is the prepended file.
This error occurs even if it is a blank file with no code in it.
I even tried to include the simpletest in this file and put this on top
if (! defined('SIMPLE_TEST')) {
    define('SIMPLE_TEST','C:/localweb/websites/site1/simpletest/');
}
require_once(SIMPLE_TEST . 'autorun.php');

but i still get the error.
If I remove the prepend configuration in php.ini then the test cases run
fine. I am running php 5.2.0 on apache. I found the same problem running on
IIS and 5.2.4
Please advise on what the problem might be.

Thanks,
Kailash Vyas
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
(Continue reading)

Patrick Mosby | 16 Jul 11:31

Simpletest not working properly with Xampp

Hi,

yesterday I was going through the Simpletest tutorial on  
simpletest.org and all went quite smooth until I reached the "Group  
test tidy up" section where addFile() is used to add the test cases to  
the all_tests.php.

After refactoring the code I always get those error messages and  
obviously the tests don't run:

Warning: SimpleFileLoader::include_once(log_test.php)  
[function.SimpleFileLoader-include-once]: failed to open stream: No  
such file or directory in/Applications/xampp/xamppfiles/htdocs/ 
simpletest-tutorial/test/simpletest/test_case.php on line 391

Warning: SimpleFileLoader::include_once() [function.include]: Failed  
opening 'log_test.php' for inclusion (include_path='.:/Applications/ 
xampp/xamppfiles/lib/php') in/Applications/xampp/xamppfiles/htdocs/ 
simpletest-tutorial/test/simpletest/test_case.php on line 391

Warning: file_get_contents(log_test.php) [function.file-get-contents]:  
failed to open stream: No such file or directory in /Applications/ 
xampp/xamppfiles/htdocs/simpletest-tutorial/test/simpletest/ 
test_case.php on line 428

Warning: SimpleFileLoader::include_once(clock_test.php)  
[function.SimpleFileLoader-include-once]: failed to open stream: No  
such file or directory in/Applications/xampp/xamppfiles/htdocs/ 
simpletest-tutorial/test/simpletest/test_case.php on line 391

(Continue reading)

Noel Darlow | 5 Jul 17:53

run same tests past different implementations

Hi

Recently I needed to run the same tests past a list of different
classes. There are different options for implementing a
foo() method and they all have to meet the same requirements.

So, Phemto to the rescue. This is how it looks on the surface:

abstract class ForTestsOfSomething extends UnitTestCase {

    function getTestableClasses() {
        return array(
            'Flavour_1', 
            'Flavour_2', 
            );
    }

Tests don't depend on any concrete class:

class MyTestCase extends ForTestsOfSomething {

    function test() {
        $foo = $this->injector()->instantiate(
            'InterfaceImplementedByFlavours', 
            $args)
    }

The test case will be run repeatedly, once for each of the classes
specified in getTestableClasses().

(Continue reading)

Travis Swicegood | 29 Jun 16:58

New software package using SimpleTest

Hey guys;

I was talking with some of the devs at Ning this past week and found  
out that they use SimpleTest for all of the testing of their PHP  
apps.  We should add them to the list of happy ST users :-)

-T

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
Elijah Insua | 27 Jun 17:45

Licensing Question

Greetings,

I have created an ajax test runner initially using PHPUnit.
Due to its flexible nature I have decided to include support for 
SimpleTest as well.
The project is licensed under the BSD license and I'm concerned about how
releasing it as such would effect my ability to distribute my project.

Source for connector: 
http://trac.blerby.com/browser/project/TestRunner/library/Blerby/TestRunner/Runner/SimpleTest/Reporter.php

I am not 'linking or compiling' the source in to the project, but I 
would like to make certain that there is no breach.

Thank You,

Elijah Insua

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php

Gmane