Share

SimpleTest

Tracker: Feature Requests

5 SimpleBrowser/SimplePage: allow access to response/headers - ID: 2886668
Last Update: Comment added ( sf-robot )

There is SimplePage::getHeaders(), but it returns $this->headers->getRaw()
and not just $this->headers.

$headers would be more interesting though, since it allows e.g. to query
getLocation().

I think adding getResponse to SimpleBrowser and SimplePage would be very
useful.

This would allow to use something like the following:
$this->getBrowser()->getResponse()->getHeaders()->getLocation()
or use the isRedirect test from SimpleHttpHeaders in your tests yourself.

Have I missed something? Is there another way to access the response and/or
the headers?


daniel hahler ( blueyed ) - 2009-10-26 19:34

5

Closed

None

Mark Rickerby

Web tester

None

Public


Comments ( 4 )

Date: 2009-11-13 02:20
Sender: sf-robotSourceForge.net Site Admin

This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).


Date: 2009-10-29 18:14
Sender: maetl_

Thanks for the feedback...

I agree that it could be useful to have direct access to the objects
constructed by SimplePage, though more so with the form objects as well,
although it may play havoc with the law of demeter.

Best thing to do would be to investigate other related apis, like
HttpUnit, etc, and see whether they have a paradigm for handling this kind
of ad-hoc querying of the page/response structure.


Date: 2009-10-29 12:59
Sender: blueyedSourceForge.net DonorAccepting Donations

Yes, assertHeader() works. Thanks!

Still I think that my point is valid, and being able to use e.g. $location
directly might be more useful.


Date: 2009-10-27 08:27
Sender: maetl_

Does assertHeader() not work in this case?



Attached File

No Files Currently Attached

Changes ( 7 )

Field Old Value Date By
status_id Pending 2009-11-13 02:20 sf-robot
allow_comments 1 2009-11-13 02:20 sf-robot
close_date 2009-10-29 18:14 2009-11-13 02:20 sf-robot
status_id Open 2009-10-29 18:14 maetl_
close_date - 2009-10-29 18:14 maetl_
category_id None 2009-10-29 18:14 maetl_
assigned_to nobody 2009-10-29 18:14 maetl_