Codeception Testing with Yii Framework 2.0 [Day 8]

Today’s Objective(s)

  1. Learn to debug console PHP application
  2. Delve deeper into the “expect” function used in testModelBoolean()
  3. Try to use the entire $I->wantTo(‘load all values’); style of Codeception
  4. Research executing tests and viewing results from a browser
  5. Research best practices for Unit testing in Yii
  6. Research best pracices for acceptance/functional testing in Yii

Introduction

I’m really hoping that setting up debugging for PHP via CLI is easy since today is Friday and I would like to finish up early… let’s get straight into it.

At the moment I’m currently using PHP Storm (Using the 30 day trial to see if it’s something I would like to purchase, so far I’m on the fence since Netbeans does all that I currently need just as well as PHP Storm. But I’m going to try and expand my horizons and attempt to use everything PHP Storm has to offer before I make that decision), so this post will center mostly around using PHP Storm, although I think there will be some base PHP setup required as well.

Links

Links I find during the course of this post will be put in this section with a rating on usefulness:

  • Stackoverflow question
    • The second answer shows promise, PHP Storm is stopping on the first line of executing codeception when I run “codecept run unit”. And it stops at my breakpoint! (I was about to say that it wasn’t stopping at my breakpoint, but I wasn’t running it from the tests folder :D )

Conclusion

Well that was easy enough, I now know how to debug a script that is being used in a console terminal. Although I don’t know how exactly, but I’m going to chalk this up as a win (Already started this an hour ago, fortunately hit that link just after starting to write this post to keep me going at it). Think I will have to delve deeper into xdebug to know more of the intricacies involved, but that’s out of scope for this topic.

 

Upcoming Objective(s)

  1. Learn to debug console PHP application
  2. Delve deeper into the “expect” function used in testModelBoolean()
  3. Try to use the entire $I->wantTo(‘load all values’); style of Codeception
  4. Research executing tests and viewing results from a browser
  5. Research best practices for Unit testing in Yii
  6. Research best pracices for acceptance/functional testing in Yii

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>