New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chainable set() #5392
Chainable set() #5392
Conversation
Test please. |
public function testSetChained() { | ||
$this->subject->set('testing', 'value') | ||
->set('foo', 'bar'); | ||
$this->assertEquals(['testing' => 'value', 'foo' => 'bar'], $this->subject->viewVars); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would also add an assert to check type of return value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any idea why such a test fails? Maybe we need to use a real class instead of a trait?
https://travis-ci.org/cakephp/cakephp/jobs/43793912#L231
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can't use instanceof on traits. You could assertSame($this->subject $result); though.
Thanks :) |
PR for #5318
As suggested makes following possible: