Closed iwalkalone69 closed 8 years ago
Test updated.
Note the comment above this test indicating that it's intended to be a unit test. Your change makes it rely on the behavior of the client dependency so that it becomes an integration test.
To correct this:
$client = $this->getMockClient();
$this->bot->setClient($client);
$this->bot->setLogger($logger);
Phake::verify($client)->setLogger($logger);
This makes it a unit test again because it no longer relies on the behavior of the setLogger()
and getLogger()
methods of the client dependency, only verifies that setLogger()
is called with the correct parameter.
Updated test.
@iwalkalone69 Sorry, I did not mean to imply that my example constituted the whole test. You've removed the assignment for $logger
, which is still needed.
Probably is this what elazar wants:
public function testSetLogger()
{
$client = $this->getMockClient();
$logger = $this->getMockLogger();
$this->bot->setClient($client);
$this->bot->setLogger($logger);
$this->assertSame($logger, $this->bot->getLogger());
Phake::verify($client)->setLogger($logger);
}
@enebe-nb Not sure @iwalkalone69 is still monitoring this issue. If you'd care to re-submit this PR with appropriate fixes, I'll be happy to merge it. :)
Sorry. I had to leave this for a while because I had to focus on another thing. I will take care now.
@iwalkalone69 No worries, looks like @enebe-nb beat you to it. ;)
That's right! Thanks @elazar and @enebe-nb !
…ger of irc connection to take effect.