Codeception Testing with Yii Framework 2.0 [Day 10]

Today’s¬†Objective(s)

  1. List the assertions that can be done using the result of expect
  2. Try to use the entire $I->wantTo(‘load all values’); style of Codeception
  3. Research executing tests and viewing results from a browser
  4. Research best practices for Unit testing in Yii
  5. Research best pracices for acceptance/functional testing in Yii

Introduction

For Sunday’s update it will be short and sweet, will list out the different assertions that can be done using the result of the expect function, which isn’t a huge list :)

  • equals
  • notEquals
  • contains
  • notContains
  • greaterThan
  • lessThen
  • greaterOrEquals
  • lessOrEquals
  • true
  • false
  • null
  • notNull
  • isEmpty
  • notEmpty
  • hasKey
  • hasntKey

As I had initially theorized, this are all calls to a different assert from the PHPUnit framework of generally the same name:

public function equals($expected)
{
    a::assertEquals($expected, $this->actual, $this->description);
}

Conclusion

With that tangent finally wrapped up. Can get back to more of the finer parts of unit testing using Codeception, I’m looking forward to it! :)

Upcoming Objective(s)

  1. Try to use the entire $I->wantTo(‘load all values’); style of Codeception
  2. Research executing tests and viewing results from a browser
  3. Research best practices for Unit testing in Yii
  4. 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>