--- layout: post title: "Codeception 1.6.7" date: 2013-09-14 22:03:50 --- This release is minor, yet fixes lots of bugs you might have encountered. If you didn't encounter them, well, then, lucky you. Still it's a good idea to upgrade. Here is the list of changes. * **fix to 80 port issue**, if you had problems connecting to server via PhpBrowser, then this must be it. Thanks to **@tiger-seo**. * fix in REST module when using `application/json` header and passing parameters. * **seeJsonResponseContains** of REST can now search on all nesting levels. Details below. * fix to Sequence module. * Step class code improved by **guilhermeFranco** * Using suite with defined namespace was improved by **@Borales**. * Generators fixes by **@piccagliani** and **davert**. ## Rest Module Changes Example *added on 09/15/2013* `seeJsonResponseContains` behavior is less strict now. Now you it checks for any inclusion of provided json in Response, and works for unordered arrays as well. Here is an example. {% highlight php %} seeResponseContainsJson(array('ticket' => array('title' => 'Bug should be fixed'))); $I->seeResponseContainsJson(array('name' => 'Davert')); $I->seeResponseContainsJson(array('user' => array('name' => 'Davert'))); ?> {% endhighlight %} In previous versions, only the first assertion would pass. But now `seeJsonResponseContains` will scan for inclusion on all levels of response json. There was no other way to get it tested unordered arrays. Until 1.6.7. Here is a sample response: {% highlight json %} [ { "id": 1, "name": "Dalhousie Website", "url": "http://www.dal.ca", "hashed_url": "ad920603a18be8a41207c0529200af45" }, { "id": 2, "name": "Wikipedia - Brasil", "url": "http://pt.wikipedia.org/wiki/Brasil", "hashed_url": "01203b7a9a2a27c22bc828419d4b7dc9" } ] {% endhighlight %} And test part that was failing in previous versions: {% highlight php %} seeResponseContainsJson(['url' => "http://pt.wikipedia.org/wiki/Brasil"]); ?> {% endhighlight %} Example taken from [#330](https://github.com/Codeception/Codeception/issues/330) The case here, if you didn't know the index of element, you couldn't verify it with `seeJsonResponseContains`. If you were using indexes, tests still should work for you. Another change is checks for `null` values in response. Actually, we deserialized them in empty strings `""`, and this was a regular workaround to replace `null` with `""` in tests as proposed in [#381](https://github.com/Codeception/Codeception/issues/381). But if you did that, you should update your tests for 1.6.7, as `null` work as expected now. So this is the changes that might affect your tests. If you got issues. `seeJsonResponseContains` has much more detailed output on fails, so it would be easier to find the cause and get it fixed. ### Update [redownload](http://codeception.com/thanks.html) your `codeception.phar` for update: {% highlight bash %} wget http://codeception.com/codecept.phar -O codecept.phar {% endhighlight %} for composer version {% highlight bash %} $ php composer.phar update {% endhighlight %}