simpletest

SimpleTest assertTags - loose matching? (for CakePHP)

I'd like to use SimpleTest to set up some functionality tests for our project - in particular, we have a very busy page which has some random components and some static components, and I'd like to be able to write a simple test which only confirms the static bits (preferably only the one or two most important ones). In other words, I wa...

Invoking a URL and retrieving the rendered HTML page in Phing

Hi all, So this is my dilemma - I am using the excellent codeigniter-simpletest library by Eric Barnes (http://github.com/ericbarnes/codeigniter-simpletest). Its perfect for my purposes, as it adds an endpoint onto the test deployment of my CodeIgniter application, from which I have a dashboard to run all my unit tests and view the resu...

Using Simpletest PHP "unit testing for PHP", getting error message "Deprecated: Assigning the return value of new by reference is deprecated "

I am new to using simpletest: http://www.simpletest.org/ for PHP and am using PHP 5.2* on my server, when I try to set up an initial test script based on their demo, I get a page full of errors like the one below... I am not sure if this is something to do with simpletest not being compatible with PHP 5.* or what the issue is, any insigh...

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

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...

how create selenium test suite for Simpletest php test cases

hi i am working with selenium RC with PHP simpletest cases....i am having 111 php scripts.. i am writing one of them for ready reference : // To see this example, you need to have Simpletest library. // You can't run simpletest with E_STRICT require_once '/opt/lampp/lib/php/PHPUnit/Testing/Selenium.php'; require_once '/opt/lampp/htdoc...

How to catch an "undefined index" E_NOTICE error in simpleTest ?

I would like to write a test using simpleTest that would fail if the method I'm testing results in a PHP E_NOTICE "undefined index : foo". I tried expectError() and expectException() without success. The simpleTest webpage indicate that simpleTest isn't able to catch compile time PHP errors, but E_NOTICE seems to be a run time error. I...

Using the set redirectUrl methods in Zend Redirector action helper

I'm unit testing some extensions of Zend_Controller_Action in SimpleTest. I want to be able to set a redirect url using the set methods of the Redirector action helper, and then use Redirector's redirectAndExit() method to actually redirect later in the process. This process doesn't seem to be working as I expected from reading the doc...

What could change the directory in php Windows besides chdir() and chroot()? (Simpletest include file bug in Windows)

(Sorry if this is titled poorly. I'm actually trying to accomplish two things - find out how the current directory can get changed in PHP, and fix a bug in Simpletest running on WAMP.) I'm running SimpleTest (simpletest.org) on my Windows 7 local machine on EasyPHP (a WAMP variation). When I run tests, the directory changes from the l...

SimpleTest with CodeIgniter -- won't identify file -- variables die?

I am trying to use SimpleTest with CodeIgniter, using code supplied by maroonbytes. I am using LAMP and NetBeans 6.9. The test.php page loads up in my browser. I have a stub test in place and it shows in the drop-down selections. When I try to run it, I get 2 PHP errors: Message: include_once(/var/www/sparts3/main/tests/basic...

How can I write tests for file upload in PHP ?

I'm using simpleTest to write my PHP tests. I'm writing a file upload plugin and was wondering how I may be testing it. I would like to check that the file is correctly uploaded, in the right folder, that error are correctly returned when needed, etc. How do I emulate a file upload (through the $_FILES variable) ? Are there any issues ...

How to run a single test method in simpletest unittest class ?

This is my Unit Test class <? require_once '../simpletest/unit_tester.php'; require_once '../simpletest/reporter.php'; class Academic extends UnitTestCase { function setUp() { } function tearDown() { } function testAc1() { } function testAc4() { ...

Convert from SimpleTest to PHPUnit $this->UnitTestCase('message .....');

Hi, Which action/method is in PHPUnit equal to in simpleTest: $this->UnitTestCase('message .....') Edit: Sorry for my mistake I think what I asking about not exist in simple test directly its just our extended class. But this method display message in begining of test- how its done with PHPUnit? Thanks ...

How do you run SimpleTest from Hudson?

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. ...

Missing Table with Simpletest in CakePHP reloaded

Hey, the solution given here: http://stackoverflow.com/questions/693071/missing-table-with-simpletest-in-cakephp used to work for me. But now I'm facing weird problems like empty DESCRIBE statements: Query: DESCRIBE Query: DESCRIBE Query: DESCRIBE Query: SELECT UserDatum.nome FROM AS UserDatum WHERE user_type_id IS NULL ORDER BY no...

How do I test my plug-in interface which uses an abstract class?

I'm using PHP 5.3 and SimpleTest, but more general answers are welcome. Each plug-in will be a class which extends an abstract class... how do I test that this interface works properly? Do I have to create several plug-ins and test them? Or is there a more satisfying way? As an example, imagine writing something to represent money. User...

In SimpleTest, is there a way to emulate a MockClass::expectOnce()?

Using PHP/SimpleTest, I want to test if a method calls a static method of another class. Can this be done with a mock class? ...