tag:blogger.com,1999:blog-28215292.post7199907516903669401..comments2024-03-25T08:39:21.481+01:00Comments on DragonBe's PHP blog: Unit testing with Zend Framework 1.8+M. van Damhttp://www.blogger.com/profile/12610668749799675317noreply@blogger.comBlogger21125tag:blogger.com,1999:blog-28215292.post-80932607007442555232011-04-27T23:23:50.051+02:002011-04-27T23:23:50.051+02:00@anonymous: if you experience the most discussed e...@anonymous: if you experience the most discussed error regarding the "default" module missing, you can leave out parent::setUp() in the ControllerTestCase::setUp() method.<br /><br />I mentioned it also during my Zend Webinar at http://www.zend.com/en/webinar/Framework/70170000000bUkI-Unit-testing-since-ZF1-8-20110119.flv<br /><br />Good luckM. van Damhttps://www.blogger.com/profile/12610668749799675317noreply@blogger.comtag:blogger.com,1999:blog-28215292.post-36384925195825386202011-04-27T18:22:07.334+02:002011-04-27T18:22:07.334+02:00I followed your example and I'm pretty close t...I followed your example and I'm pretty close to having it working. I'm getting the following error:<br /><br><br />1) IndexControllerTest::testCallingRootTriggersIndex<br />Zend_Controller_Exception: No default module defined for this application<br /><br><br />We have the framework separate from the project code to make it easier to update the framework and that caused some file path issues that we believe are resolved, but we are now getting this final error.<br /><br><br />Do you have any possible solutions or things I can check?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-28215292.post-82276295335901000102011-03-29T11:35:51.351+02:002011-03-29T11:35:51.351+02:00I wanted to use Phactory to test part of the submi...I wanted to use Phactory to test part of the submit action source as given below: http://awesomescreenshot.com/050a0p2a6<br /><br />Using Phactory, it is assured that the data is going into DB but the problem is in code coverage as some of the lines are still highlighted in red.<br /><br />How do i test those lines so that the code coverage will be shown in green?Anonymoushttps://www.blogger.com/profile/00960182826917860264noreply@blogger.comtag:blogger.com,1999:blog-28215292.post-47861683672609827152011-02-06T12:46:11.822+01:002011-02-06T12:46:11.822+01:00I'm just starting out with Zend Framework and ...I'm just starting out with Zend Framework and Unit Testing so this tut is going to prove useful.<br />I have a question about code coverage with XDebug. <br /><br />You say "I've setup my test environment that directory log/report is aliased by /report, so I can view the code coverage reports (requires XDebug)."<br /><br />Could you provide some pointers on how to do this?<br /><br />Cheers<br />David [MonkeyPHP]Anonymoushttps://www.blogger.com/profile/18212729942810997072noreply@blogger.comtag:blogger.com,1999:blog-28215292.post-55002589153161590962011-01-05T22:02:31.709+01:002011-01-05T22:02:31.709+01:00I really like this tutorial. However, one recommen...I really like this tutorial. However, one recommendation to prevent out of memory problems:<br /><br />Exclude the Zend Framework library from code coverage analysis:<br /><br />[...]<br /> <br /> <br /> ../library/Custom<br /> ../application<br /> <br /> ../application<br /> <br /> <br /> <br />[...]<br /><br />Otherwise the hole Framework will be checked. I wasn't able to get this working, even with memory_limit set to 1024M (my dev environment is hosted on a "small" but reliable system).Jan Brinkmannhttp://the-luckyduck.denoreply@blogger.comtag:blogger.com,1999:blog-28215292.post-71381462526478446402010-07-29T14:06:24.457+02:002010-07-29T14:06:24.457+02:00Thanks for giving us more knowledge on unit testin...Thanks for giving us more knowledge on unit testing deeply. One question i want to raise here that how to overcome the limitations of the unit testing or can we use unit testing along with integration testing to extent its results quality.Unit Testinghttp://artofunittesting.blogspot.com/noreply@blogger.comtag:blogger.com,1999:blog-28215292.post-86054982663750361962010-03-31T14:55:54.394+02:002010-03-31T14:55:54.394+02:00@shubhangi
Modules are nothing more then structur...@shubhangi<br /><br />Modules are nothing more then structured pieces of your application. Working this described way allows you to test your whole application, modules and library components included.<br /><br />@c unit testing<br />What do you mean with everything ? Have you tried the quickstart guide from Zend Framework ? This setup works well with it.<br />See http://framework.zend.com/docs/quickstart for more detailsM. van Damhttps://www.blogger.com/profile/12610668749799675317noreply@blogger.comtag:blogger.com,1999:blog-28215292.post-65792781457233150842010-03-31T07:22:13.590+02:002010-03-31T07:22:13.590+02:00This will help me a lot with unit testing! I'm...This will help me a lot with unit testing! I'm trying to work on the same build source, but am having a little trouble with getting everything to work like I want it to.c unit testinghttp://www.vectorcast.com/software-testing-products/c++-unit-testing.phpnoreply@blogger.comtag:blogger.com,1999:blog-28215292.post-22334297353910563532010-02-17T07:10:02.814+01:002010-02-17T07:10:02.814+01:00Thanks for sharing unit testing so deeply.Can we a...Thanks for sharing unit testing so deeply.Can we aplly it to Module testing as well?<br /><br /><a href="http://www.winprizesonline.com" rel="nofollow">Sweeptakes</a>Unknownhttps://www.blogger.com/profile/09643393621014747048noreply@blogger.comtag:blogger.com,1999:blog-28215292.post-6067286834244983642010-01-19T09:48:24.696+01:002010-01-19T09:48:24.696+01:00@Federico: do you have published an article of tha...@Federico: do you have published an article of that setup ? I'm really interested in seeing this kind of setup.M. van Damhttps://www.blogger.com/profile/12610668749799675317noreply@blogger.comtag:blogger.com,1999:blog-28215292.post-75561286755550495972010-01-19T09:46:54.552+01:002010-01-19T09:46:54.552+01:00@misbehavens: I know, apparently there are a coupl...@misbehavens: I know, apparently there are a couple of escaping issues here. But any given XML editor will show you immediately what's wrong so you can fix it.<br /><br />This example shows more the general idea behind unit testing instead being a simple copy/paste example.<br /><br />I'm sorry for the misunderstanding and I'm looking into the whole escaping issue (already pointed out by @ananonymous #1 and @anonymous #2)<br /><br />@anynymous #3: XDebug provides extra functionality used by PHPUnit to generate those coverage reports. I'm sure Zend Debug provides similar functionality, but I'm not sure how to implement it along with PHPUnit.M. van Damhttps://www.blogger.com/profile/12610668749799675317noreply@blogger.comtag:blogger.com,1999:blog-28215292.post-83772102725601460562010-01-19T01:12:00.417+01:002010-01-19T01:12:00.417+01:00Thanks for your post. Can you please talk about te...Thanks for your post. Can you please talk about testing models in a 1.8+ application? Thank you! Also, you still have errors in your XML code sample.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-28215292.post-53594616904761474322010-01-06T23:43:10.327+01:002010-01-06T23:43:10.327+01:00What about Zend Debug? Can you get this to work w...What about Zend Debug? Can you get this to work with it instead of XDebug?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-28215292.post-75075310721369559702009-11-05T01:12:21.303+01:002009-11-05T01:12:21.303+01:00One thing I found out a couple of months ago: If y...One thing I found out a couple of months ago: If you have a build server and you are running Hudson, you can generate the code covergae report inside your workspace, bookmark any html page and share it with other members of your team.Federicohttp://blog.fedecarg.comnoreply@blogger.comtag:blogger.com,1999:blog-28215292.post-25553184477971898622009-11-04T00:37:37.340+01:002009-11-04T00:37:37.340+01:00More on missing code: It looks like the <'s...More on missing code: It looks like the <'s were escaped.<br /><br />Thanks again,<br />GregAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-28215292.post-50508614199257184312009-11-04T00:36:07.290+01:002009-11-04T00:36:07.290+01:00It looks like the xml for phpunit.xml is a bit mes...It looks like the xml for phpunit.xml is a bit messed up. No opening < for most of it, maybe other stuff?<br /><br />Great post, though. Very helpful!<br /><br />GregAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-28215292.post-89918249744487691302009-11-03T22:59:29.267+01:002009-11-03T22:59:29.267+01:00@Lance,
Glad to help you out here, I'll proba...@Lance,<br /><br />Glad to help you out here, I'll probably put some more examples on my blog, depending on the amount of questions I get.<br /><br />@mweierophinney,<br /><br />I did not know that, and you haven't blogged about it yet... but I'll look in to it and will post a follow up once I have figured it out.<br /><br />Tnx for the hint !<br /><br />@Giorgio,<br /><br />Yes, this is solely for testing your controllers, actions and interactions with data sources (internal and external).<br /><br />But I have to admit, having this combined with my own library components, I have one testsuite running all tests, independent from their purpose.M. van Damhttps://www.blogger.com/profile/12610668749799675317noreply@blogger.comtag:blogger.com,1999:blog-28215292.post-71706035236079208592009-11-03T21:33:55.998+01:002009-11-03T21:33:55.998+01:00Remember that this is how to test your controllers...Remember that this is how to test your controllers; to test other classes there is no need for the Zend_Test component, plain old phpunit will do a perfect job.Giorgiohttps://www.blogger.com/profile/12689416577856305650noreply@blogger.comtag:blogger.com,1999:blog-28215292.post-215644991274586052009-11-03T12:35:22.119+01:002009-11-03T12:35:22.119+01:00BTW, as of 1.9.5, you can now assign a Zend_Applic...BTW, as of 1.9.5, you can now assign a Zend_Application instance to $this->bootstrap; Zend_Test_PHPUnit_ControllerTestCase will then bootstrap() it during setUp().Matthew Weier O'Phinneyhttps://www.blogger.com/profile/07032108589083372184noreply@blogger.comtag:blogger.com,1999:blog-28215292.post-470849100565583352009-11-02T07:09:09.127+01:002009-11-02T07:09:09.127+01:00Thanks, very nice tutorial.Thanks, very nice tutorial.Yaroslav Vorozhkohttp://pro100pro.comnoreply@blogger.comtag:blogger.com,1999:blog-28215292.post-37478772767025518272009-11-01T22:53:04.951+01:002009-11-01T22:53:04.951+01:00I left ZendCon knowing what unit testing was, and ...I left ZendCon knowing what unit testing was, and why I needed to do it, but didn't have any idea how to start... thanks for the "foot in the door" tutorial.Unknownhttps://www.blogger.com/profile/18087322287365884668noreply@blogger.com