Steven Balthazor | 3 Dec 15:57

Re: Error in PHP Unt test

On Tue, Dec 2, 2008 at 9:29 PM, arpit agarwal <arpit_adam@...> wrote:
> Hi,
>
> As i extract the source file i got the eclipse.php and unit_tester.php with
> other files and i had placed at mention path yet it is given error on
> console.I am using PHP 5
>
>
> unning:
>
> echo "<?php
> $path='C:\simpletest_1.0.1.eclipse_0.2.4';ini_set('include_path',
> get_include_path().PATH_SEPARATOR .
> realpath($path));ini_set('html_errors','0');$fullpath =
> realpath('C:/PHP/workspace/fckEditorSample/fckeditor/test.test.php');$pathparts
> = pathinfo($fullpath);$filename =
> $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
> GroupTest($filename);$test->addTestFile($fullpath);$test->run(new
> XmlReporter()); ?>" | "C:\Program Files\PHP\php.exe" -q -c "C:\Program
> Files\PHP\php.ini"
>
> *************
>
> PHP Warning: include_once(eclipse.php): failed to open stream: No such file
> or directory in C:\Documents and Settings\arpit716\Local
> Settings\Temp\Simpletest54908.php on line 1
>
> PHP Stack trace:
>
> PHP 1. {main}() C:\Documents and Settings\arpit716\Local
(Continue reading)

Florin Miu | 2 Dec 21:23
Favicon

Roadmap for simpletest

Hello,I'm starting to build my own php5 framework and I'm going to use TDD. I have to choose between
simpletest and phpunit but simple test is not php5 ready yet. Is there a roadmap for the development for
simpletest?Also what is the best way to test database abstraction classes (connecting, returning
recordsets)? I've seen PHPUnit has a database extension for this purpose. Is there a way to do this with
simple test?Thanks.
Florin

      
-------------------------------------------------------------------------
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=/
Steven Balthazor | 2 Dec 15:40

Re: Error in PHP Unt test

On Mon, Dec 1, 2008 at 11:27 PM, arpit agarwal <arpit_adam@...> wrote:
> Hi,
>
> I have followed all proper steps stated in Read me and all are successfully done but there are no option is
coming in eclipse while creating a ner project as sample as stated in Docs.
>
> And while i am trying to Run Test Case as Run As Simple test as option started coming
> Its giving error
>
> Running:
> echo "<?php $path='C:\simpletest_1.0.1.eclipse_0.2.4\plugins';ini_set('include_path',
get_include_path().PATH_SEPARATOR . realpath($path));ini_set('html_errors','0');$fullpath =
realpath('C:/PHP/workspace/fckEditorSample/fckeditor/test.test.php');$pathparts =
pathinfo($fullpath);$filename =
$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
GroupTest($filename);$test->addTestFile($fullpath);$test->run(new XmlReporter()); ?>" |
"C:\Program Files\PHP\php.exe" -q -c "C:\Program Files\PHP\php.ini"
> *************
> Process returned: 255
> Process error:
> PHP Warning: include_once(eclipse.php): failed to open stream: No such file or directory in
C:\Documents and Settings\arpit716\Local Settings\Temp\Simpletest14634.php on line 1
> PHP Stack trace:
> PHP 1. {main}() C:\Documents and Settings\arpit716\Local Settings\Temp\Simpletest14634.php:0
> PHP Warning: include_once(): Failed opening 'eclipse.php' for inclusion
(include_path='.;C:\php5\pear;C:\simpletest_1.0.1.eclipse_0.2.4\plugins') in C:\Documents
and Settings\arpit716\Local Settings\Temp\Simpletest14634.php on line 1

The path that you have set for Simpletest is wrong.  According to the
trace, Simpletest is trying to load from the path:
(Continue reading)

Douglas Hubler | 9 Nov 02:55

Mock functions?

I find mock functions useful because many times I'm writing code that interfaces
with functions and not other objects.  I found I could mock functions with the
library
 http://code.google.com/p/php-mock-function/
without requiring runkit.  Instead I run my tests each in their own process and
control the include files and it works great.  

The php-mock-function library is very alpha and hasn't taken off.

Anyway, I just want to start a conversation on the subject. What are others 
using?

Reference
http://www.workhabit.com/labs/mock-function-testing-drupal

-------------------------------------------------------------------------
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=/
Taras Diakiw | 27 Oct 16:02

Global variables between tests/setup

Hi everyone,

I have a configuration file, which is required_once, and sets a global variable called 'root_path'.

However, when simpletest runs the third test in a test suite, root_path is unitialised. I am certain that
root_path does, in fact, get set to something prior to this point, as I have set up a break point at the line
which sets root_path (which gets hit).

config.php
-------------
$root_path = 'blah';

and then SimpleTest will load FooUnitTest as part of the 'All' Test Suite

FooUnitTest
---------------
require_once('config.php'); // doesn't get included... config.php is included as part of the Test Prolog
require_once($root_path.'Bar.php'); // fails because the $root_path global variable is unitialised
at this stage

I was wondering if SimpleTest changes global variables between unit tests. This is the only explanation of
the $root_path variable being unitialised that I can think of, as my code does not explicitly unset it.

If, in fact, SimpleTest *does* unset all of the global variables between unit tests, shouldn't it also
reset the state of whether files have been included or not.

After the following line in the 'load' function in test_case.php gets run:

$existing_globals = get_defined_vars();
include_once($test_file);
(Continue reading)

YC | 17 Oct 07:30

Can simpletest print out the value that causes failure?

Hi all, I'm new to simple test.

I've a ValidationManager that has one function to validate names.

I've written testIsValidName to be:

    function testIsValidName(){
>
>         $oVM = new ValidationManager();
>
>         $this->assertTrue($oVM->isValidName('john'));
>         $this->assertTrue($oVM->isValidName('John'));
>         $this->assertTrue($oVM->isValidName("john'dina"));
>         $this->assertTrue($oVM->isValidName("john'Dina"));
>         $this->assertTrue($oVM->isValidName("'dina"));
>         $this->assertTrue($oVM->isValidName("dina'"));
>         $this->assertTrue($oVM->isValidName('abcdefghijabcdefghij'));
>
>         $this->assertFalse($oVM->isValidName('i'));
>         $this->assertFalse($oVM->isValidName('koio9'));
>
> $this->assertFalse($oVM->isValidName('thisisaverylongnamemorethan20chars'));
>
>     }

Is this the right way to go about it?

I was thinking of creating an array of names and then using foreach() to run
through each name.
That will save me time from coding so many lines.
(Continue reading)

tarjei | 3 Oct 10:34
Favicon
Gravatar

Code coverage


Hi, does anyone have any tips on how to get coverage data out of simpletest?
Tarjei
Gravatar

simpletest.org vs. htmlspecialchars

Hi,

Currently, all documentation on simpletest.org is double-encoded, so
-> becomes -&gt; thereby making the code samples rather unreadable.

--
troels

-------------------------------------------------------------------------
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=/
Travis Swicegood | 3 Oct 00:06
Gravatar

MultipleExpectation

Hey all...

Is there a reason we don't ship with a MultipleException decorator  
that takes N expectations and passes if they all pass?

-T

-------------------------------------------------------------------------
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 Rickerby | 30 Sep 09:19
Gravatar

twist testing

http://studios.thoughtworks.com/twist-agile-test-automation/writing-tests

*cough*... arbiter ...

-------------------------------------------------------------------------
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=/
Travis Swicegood | 26 Sep 20:05
Gravatar

Re: [Simpletest-devel] Expired cookies being sent with requests

Hey Taras;

Most of the development talk goes on on the simpletest-support mailing  
list.  I've CC'd that list on this response, so everyone over there  
can see this as well.

-T

On Sep 26, 2008, at 4:50 AM, Taras Diakiw wrote:

> In case anyone else was reading this, my suggestion would not work,  
> because isExpired returns true if the cookie is a session cookie  
> (although it hasn't expired until the browser closes - go figure).  
> So instead...
>
> Add the following method to SimpleCookie class:
>
>    function isExpiredSession($now)
>    {
>        if (! $this->_expiry) {
>            return false;
>        }
>        if (is_string($now)) {
>            $now = strtotime($now);
>        }
>        return ($this->_expiry < $now);
>    }
>
> change the SimpleCookieJar::selectAsPairs function to:
>
(Continue reading)


Gmane