Development

#3246 ([PATCH] sfTestBrowser doesn't play nicely when it is instantiated more than once in one test)

You must first sign up to be able to contribute.

Ticket #3246 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

[PATCH] sfTestBrowser doesn't play nicely when it is instantiated more than once in one test

Reported by: l2k Assigned to: fabien
Priority: minor Milestone: 1.1.0 beta4
Component: tests Version: 1.1.0 DEV
Keywords: Cc:
Qualification: Unreviewed

Description

You can nicely simulate multiple users from different hosts interacting with your application by using more than one sfTestBrowser instance in one test:

$user1 = new myTestBrowser(null, '127.0.0.1');
$user2 = new myTestBrowser(null, '127.0.0.2');

This however messes up the test output:

...
ok 14 - page not redirected
...
ok 12 - page not redirected
1..12
 Looks like everything went fine.
1..14
 Looks like everything went fine.

The test:all task wrongly reports failed tests and a warning: # Looks like you planned 14 test but ran 12 extra.

The reason for this behavior is that each sfTestBrowser instance creates its own lime_test instance. By reusing the same lime_test instance these problems can be avoided. See proposed patch against http://svn.symfony-project.com/branches/1.1 r8172

Attachments

ticket3246.diff (10.1 kB) - added by l2k on 04/01/08 01:04:02.

Change History

04/01/08 01:04:02 changed by l2k

  • attachment ticket3246.diff added.

04/17/08 05:26:10 changed by fabien

  • milestone set to 1.1.0 beta4.

04/17/08 05:40:28 changed by fabien

  • status changed from new to closed.
  • resolution set to fixed.

in r8495

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting.
Sensio Labs also supports several large Open-Source projects.