for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
use PHPUnit\Framework\TestCase;
use SchoppAx\Sleeper\SleeperClient;
use SchoppAx\Sleeper\Api\Avatars;
class SleeperAvatarTest extends TestCase
{
public function testAvatar()
$value = __DIR__ . '/data/740715586f5fecd032030346acf139c5.png';
$mock = $this->createMock(Avatars::class);
$mock->expects($this->once())
->method('find')
->willReturnCallback(function($id) use ($value) {
$id
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
->willReturnCallback(function(/** @scrutinizer ignore-unused */ $id) use ($value) {
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
return $value;
});
$client = $this->createPartialMock(SleeperClient::class, ['__call']);
$client->expects($this->once())
->method('__call')
->willReturnCallback(function($name, $args) use ($mock) {
$args
->willReturnCallback(function($name, /** @scrutinizer ignore-unused */ $args) use ($mock) {
$name
->willReturnCallback(function(/** @scrutinizer ignore-unused */ $name, $args) use ($mock) {
return $mock;
$response = $client->avatars()->find('gg');
$this->assertEquals('image/png', mime_content_type($response));
}
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.