Cakephp: Integration tests cannot access console output anymore

Created on 26 Oct 2018  路  3Comments  路  Source: cakephp/cakephp

This is a (multiple allowed):

  • [x] bug
  • [x] enhancement
  • [ ] feature-discussion (RFC)

  • CakePHP Version: 3.7.0-RC1


I often want to test the whole output, not just whether it contains something, so I often used $this->_out/_err->messages() instead of the available assertion methods.

12072 changed the properties holding the input/output objects ($_in, $_out, $_rr) from protected to private (btw this isn't documented as a breaking change in the migration guide), so it's no longer possible to retrieve the generated output.

One could probably work around this by importing the trait directly and changing the properties visibility, but having to not do that would IMHO be nicer :) And while additional assertion methods might work for some, people might still want test/inspect the data in other ways that require access to the actual data, so being able to directly access the output wouldn't hurt I think.

defect enhancement

Most helpful comment

Sorry about that! I also renamed them >< I will try to get to fixing this this weekend if no one grabs it first.

All 3 comments

Changing the properties to private seems like an oversight, they should be reverted to protected.

Sorry about that! I also renamed them >< I will try to get to fixing this this weekend if no one grabs it first.

PR up

Was this page helpful?
0 / 5 - 0 ratings

Related issues

inoas picture inoas  路  3Comments

josbeir picture josbeir  路  3Comments

nrother picture nrother  路  3Comments

dereuromark picture dereuromark  路  3Comments

inoas picture inoas  路  4Comments