Re: [fw-general] Zend_Test + setcookie() = error

2008-10-10 Thread Tir


Matthew Weier O'Phinney-3 wrote:
 
 Actually... we don't have a way in the Response object yet for setting
 cookies; if we had one, that would make testing easier. I've added a
 ticket for you to track this:
 
 http://framework.zend.com/issues/browse/ZF-4520
 
It's really good idea: add in the response object methods to manipulate with
cookies. But how i can test my code, in which i use the setcookie function,
with the Zend_Test now? I mean test my code and don't receive the Cannot
modify
header information - headers already sent by error :)
-- 
View this message in context: 
http://www.nabble.com/Zend_Test-%2B-setcookie%28%29-%3D-error-tp19834606p19917831.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Zend_Test + setcookie() = error

2008-10-10 Thread Matthew Weier O'Phinney
-- Tir [EMAIL PROTECTED] wrote
(on Friday, 10 October 2008, 05:57 AM -0700):
 Matthew Weier O'Phinney-3 wrote:
  Actually... we don't have a way in the Response object yet for setting
  cookies; if we had one, that would make testing easier. I've added a
  ticket for you to track this:
  
  http://framework.zend.com/issues/browse/ZF-4520
  
 It's really good idea: add in the response object methods to manipulate with
 cookies. But how i can test my code, in which i use the setcookie function,
 with the Zend_Test now? I mean test my code and don't receive the Cannot
 modify
 header information - headers already sent by error :)

Add a check for if (!headers_sent()) before you call setcookie() for
now.

-- 
Matthew Weier O'Phinney
Software Architect   | [EMAIL PROTECTED]
Zend Framework   | http://framework.zend.com/


Re: [fw-general] Zend_Test + setcookie() = error

2008-10-08 Thread Matthew Weier O'Phinney
-- Tir [EMAIL PROTECTED] wrote
(on Monday, 06 October 2008, 02:23 AM -0700):
 In one of my plugins i set cookie in preDispatch method with the setcookie
 function. And when i try to test my controllers with descendant of the
 Zend_Test_PHPUnit_ControllerTestCase class i receive an error Cannot modify
 header information - headers already sent by. I think it occures because i
 set cookie with PHP native function, not with method of ZF classes. How can
 i set cookies to have no error ocurred?

Actually... we don't have a way in the Response object yet for setting
cookies; if we had one, that would make testing easier. I've added a
ticket for you to track this:

http://framework.zend.com/issues/browse/ZF-4520

-- 
Matthew Weier O'Phinney
Software Architect   | [EMAIL PROTECTED]
Zend Framework   | http://framework.zend.com/


[fw-general] Zend_Test + setcookie() = error

2008-10-08 Thread Tir

Hi, all!
In one of my plugins i set cookie in preDispatch method with the setcookie
function. And when i try to test my controllers with descendant of the
Zend_Test_PHPUnit_ControllerTestCase class i receive an error Cannot modify
header information - headers already sent by. I think it occures because i
set cookie with PHP native function, not with method of ZF classes. How can
i set cookies to have no error ocurred?
-- 
View this message in context: 
http://www.nabble.com/Zend_Test-%2B-setcookie%28%29-%3D-error-tp19834606p19834606.html
Sent from the Zend Framework mailing list archive at Nabble.com.