for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Zenify\DoctrineBehaviors\Tests\Loggable;
use PHPUnit\Framework\TestCase;
use Zenify\DoctrineBehaviors\Contract\Loggable\LoggerInterface;
use Zenify\DoctrineBehaviors\Loggable\LoggerCallable;
class LoggerCallableTest extends TestCase
{
/**
* @var string
*/
private $message;
* @var LoggerCallable
private $loggerCallable;
protected function setUp()
$loggerMock = $this->prophesize(LoggerInterface::class);
$that = $this;
$loggerMock->process('message')->will(function ($args) use ($that) {
$args
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
$that->message = 'someMessage';
});
$this->loggerCallable = new LoggerCallable($loggerMock->reveal());
}
public function testInvoke()
$loggerCallable = $this->loggerCallable;
$loggerCallable('message');
$this->assertSame('someMessage', $this->message);
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.