Unit Tests, Output buffering?

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Unit Tests, Output buffering?

James Dempster
Is there any reason why the unit tests are output buffered?

-- TestHelper.php #22 --
/*

 * Start output buffering
 */
ob_start();

--
/James
Reply | Threaded
Open this post in threaded view
|

Re: Unit Tests, Output buffering?

James Dempster
It also seems with the output buffering, not all of them are being ended in some of the unit tests. This leads to very large amount of memory usage. To run the all tests suite it's taking more than 160MB.

--
/James

On Thu, Apr 17, 2008 at 8:29 PM, James Dempster <[hidden email]> wrote:
Is there any reason why the unit tests are output buffered?

-- TestHelper.php #22 --
/*

 * Start output buffering
 */
ob_start();

--
/James

Reply | Threaded
Open this post in threaded view
|

Re: Unit Tests, Output buffering?

Darby Felton
In reply to this post by James Dempster
Hi James,

Yes, the reason I added this line to the TestHelper was for
accommodating the Zend_Session tests, which depend on headers_sent()
returning false prior to their running.

I did not merge this change to the release-1.5 branch [yet], as I
suspected this change would meet with some resistance (e.g., "why can't
I see test results as they occur, rather than when they are done?").

All things considered, I should probably remove this line from the
TestHelper, and the Zend_Session test suite should be rewritten such
that it does not matter whether output had occurred before the suite is run.

Does anyone else have an opinion on this to share?

Thanks!

Best regards,
Darby

James Dempster wrote:

> Is there any reason why the unit tests are output buffered?
>
> -- TestHelper.php #22 --
> /*
>  * Start output buffering
>  */
> ob_start();
>
> --
> /James
Reply | Threaded
Open this post in threaded view
|

Re: Unit Tests, Output buffering?

James Dempster
lol and this make me the resistance, aww poop.

I can't think of any way to solve this problem. I've put my thinking hat on.

--
/James

On Fri, Apr 18, 2008 at 1:07 PM, Darby Felton <[hidden email]> wrote:
Hi James,

Yes, the reason I added this line to the TestHelper was for accommodating the Zend_Session tests, which depend on headers_sent() returning false prior to their running.

I did not merge this change to the release-1.5 branch [yet], as I suspected this change would meet with some resistance (e.g., "why can't I see test results as they occur, rather than when they are done?").

All things considered, I should probably remove this line from the TestHelper, and the Zend_Session test suite should be rewritten such that it does not matter whether output had occurred before the suite is run.

Does anyone else have an opinion on this to share?

Thanks!

Best regards,
Darby


James Dempster wrote:
Is there any reason why the unit tests are output buffered?

-- TestHelper.php #22 --
/*
 * Start output buffering
 */
ob_start();

--
/James

Reply | Threaded
Open this post in threaded view
|

Re: Unit Tests, Output buffering?

Josh Team
Off topic but are you guys inferring that ZF has a TestHelper?

Thanks,
Josh Team

On Fri, Apr 18, 2008 at 7:51 AM, James Dempster <[hidden email]> wrote:
lol and this make me the resistance, aww poop.

I can't think of any way to solve this problem. I've put my thinking hat on.

--
/James


On Fri, Apr 18, 2008 at 1:07 PM, Darby Felton <[hidden email]> wrote:
Hi James,

Yes, the reason I added this line to the TestHelper was for accommodating the Zend_Session tests, which depend on headers_sent() returning false prior to their running.

I did not merge this change to the release-1.5 branch [yet], as I suspected this change would meet with some resistance (e.g., "why can't I see test results as they occur, rather than when they are done?").

All things considered, I should probably remove this line from the TestHelper, and the Zend_Session test suite should be rewritten such that it does not matter whether output had occurred before the suite is run.

Does anyone else have an opinion on this to share?

Thanks!

Best regards,
Darby


James Dempster wrote:
Is there any reason why the unit tests are output buffered?

-- TestHelper.php #22 --
/*
 * Start output buffering
 */
ob_start();

--
/James


Reply | Threaded
Open this post in threaded view
|

Re: Unit Tests, Output buffering?

James Dempster
Not sure what you mean there but the TestHelper we're talking about is
http://framework.zend.com/svn/framework/trunk/tests/TestHelper.php

It helps setup the test suite PHPUnit.

--
/James

On Fri, Apr 18, 2008 at 2:11 PM, Josh Team <[hidden email]> wrote:
Off topic but are you guys inferring that ZF has a TestHelper?

Thanks,
Josh Team


On Fri, Apr 18, 2008 at 7:51 AM, James Dempster <[hidden email]> wrote:
lol and this make me the resistance, aww poop.

I can't think of any way to solve this problem. I've put my thinking hat on.

--
/James


On Fri, Apr 18, 2008 at 1:07 PM, Darby Felton <[hidden email]> wrote:
Hi James,

Yes, the reason I added this line to the TestHelper was for accommodating the Zend_Session tests, which depend on headers_sent() returning false prior to their running.

I did not merge this change to the release-1.5 branch [yet], as I suspected this change would meet with some resistance (e.g., "why can't I see test results as they occur, rather than when they are done?").

All things considered, I should probably remove this line from the TestHelper, and the Zend_Session test suite should be rewritten such that it does not matter whether output had occurred before the suite is run.

Does anyone else have an opinion on this to share?

Thanks!

Best regards,
Darby


James Dempster wrote:
Is there any reason why the unit tests are output buffered?

-- TestHelper.php #22 --
/*
 * Start output buffering
 */
ob_start();

--
/James



Reply | Threaded
Open this post in threaded view
|

Re: Unit Tests, Output buffering?

Josh Team
Ah I was hoping there was a nice little wrapper to PHP Unit :-p but I guess not, going to have to be tackling some php unit testing here soon.

On Fri, Apr 18, 2008 at 8:31 AM, James Dempster <[hidden email]> wrote:
Not sure what you mean there but the TestHelper we're talking about is
http://framework.zend.com/svn/framework/trunk/tests/TestHelper.php

It helps setup the test suite PHPUnit.

--
/James


On Fri, Apr 18, 2008 at 2:11 PM, Josh Team <[hidden email]> wrote:
Off topic but are you guys inferring that ZF has a TestHelper?

Thanks,
Josh Team


On Fri, Apr 18, 2008 at 7:51 AM, James Dempster <[hidden email]> wrote:
lol and this make me the resistance, aww poop.

I can't think of any way to solve this problem. I've put my thinking hat on.

--
/James


On Fri, Apr 18, 2008 at 1:07 PM, Darby Felton <[hidden email]> wrote:
Hi James,

Yes, the reason I added this line to the TestHelper was for accommodating the Zend_Session tests, which depend on headers_sent() returning false prior to their running.

I did not merge this change to the release-1.5 branch [yet], as I suspected this change would meet with some resistance (e.g., "why can't I see test results as they occur, rather than when they are done?").

All things considered, I should probably remove this line from the TestHelper, and the Zend_Session test suite should be rewritten such that it does not matter whether output had occurred before the suite is run.

Does anyone else have an opinion on this to share?

Thanks!

Best regards,
Darby


James Dempster wrote:
Is there any reason why the unit tests are output buffered?

-- TestHelper.php #22 --
/*
 * Start output buffering
 */
ob_start();

--
/James




Reply | Threaded
Open this post in threaded view
|

Re: Unit Tests, Output buffering?

Darby Felton
In reply to this post by Josh Team
Hi Josh,

I'm not inferring it, but I'll proclaim it:

ZF has a TestHelper! :)

There is one for the trunk in trunk/tests/TestHelper.php, and there is
one in the incubator, too.

Maybe this isn't what you think it might be? Basically, it sets up the
environment (e.g., include_path) for making ZF test suites run smoothly.

Best regards,
Darby

Josh Team wrote:

> Off topic but are you guys inferring that ZF has a TestHelper?
>
> Thanks,
> Josh Team
>
> On Fri, Apr 18, 2008 at 7:51 AM, James Dempster <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     lol and this make me the resistance, aww poop.
>
>     I can't think of any way to solve this problem. I've put my thinking
>     hat on.
>
>     --
>     /James
>
>
>     On Fri, Apr 18, 2008 at 1:07 PM, Darby Felton <[hidden email]
>     <mailto:[hidden email]>> wrote:
>
>         Hi James,
>
>         Yes, the reason I added this line to the TestHelper was for
>         accommodating the Zend_Session tests, which depend on
>         headers_sent() returning false prior to their running.
>
>         I did not merge this change to the release-1.5 branch [yet], as
>         I suspected this change would meet with some resistance (e.g.,
>         "why can't I see test results as they occur, rather than when
>         they are done?").
>
>         All things considered, I should probably remove this line from
>         the TestHelper, and the Zend_Session test suite should be
>         rewritten such that it does not matter whether output had
>         occurred before the suite is run.
>
>         Does anyone else have an opinion on this to share?
>
>         Thanks!
>
>         Best regards,
>         Darby
>
>
>         James Dempster wrote:
>
>             Is there any reason why the unit tests are output buffered?
>
>             -- TestHelper.php #22 --
>             /*
>              * Start output buffering
>              */
>             ob_start();
>
>             --
>             /James
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Unit Tests, Output buffering?

weierophinney
Administrator
In reply to this post by Josh Team
-- Josh Team <[hidden email]> wrote
(on Friday, 18 April 2008, 08:11 AM -0500):
> Off topic but are you guys inferring that ZF has a TestHelper?

tests/TestHelper.php does some behind-the-scenes stuff to ensure that
things like include_paths are properly set, test configuration loaded (a
number of test suites have optional tests that can be run based on
whether or not there are services available, or which need credentials
to run), and more.


> On Fri, Apr 18, 2008 at 7:51 AM, James Dempster <[hidden email]> wrote:
>
>     lol and this make me the resistance, aww poop.
>
>     I can't think of any way to solve this problem. I've put my thinking hat
>     on.
>
>     --
>     /James
>
>
>     On Fri, Apr 18, 2008 at 1:07 PM, Darby Felton <[hidden email]> wrote:
>
>         Hi James,
>
>         Yes, the reason I added this line to the TestHelper was for
>         accommodating the Zend_Session tests, which depend on headers_sent()
>         returning false prior to their running.
>
>         I did not merge this change to the release-1.5 branch [yet], as I
>         suspected this change would meet with some resistance (e.g., "why can't
>         I see test results as they occur, rather than when they are done?").
>
>         All things considered, I should probably remove this line from the
>         TestHelper, and the Zend_Session test suite should be rewritten such
>         that it does not matter whether output had occurred before the suite is
>         run.
>
>         Does anyone else have an opinion on this to share?
>
>         Thanks!
>
>         Best regards,
>         Darby
>
>
>         James Dempster wrote:
>
>             Is there any reason why the unit tests are output buffered?
>
>             -- TestHelper.php #22 --
>             /*
>              * Start output buffering
>              */
>             ob_start();
>
>             --
>             /James
>
>
>
>

--
Matthew Weier O'Phinney
Software Architect       | [hidden email]
Zend - The PHP Company   | http://www.zend.com/