for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Yiisoft\Proxy\Tests;
use PHPUnit\Framework\TestCase;
use Yiisoft\Proxy\Proxy;
final class ProxyTest extends TestCase
{
public function testGet(): void
$handler = new ProxyHandler();
$proxied = new Proxied();
$proxy = new Proxy($proxied, $handler);
$proxy->number1;
number1
Yiisoft\Proxy\Proxy
__get
$this->assertEquals(['get', 'number1', $proxied], end($handler->calls));
}
public function testSet(): void
$proxy->number1 = 1;
__set
$this->assertEquals(['set', 'number1', 1, $proxied], end($handler->calls));
public function testCall(): void
$proxy->setNumber1(1);
setNumber1()
__call
If this is a false-positive, you can also ignore this issue in your code via the ignore-call annotation
ignore-call
$proxy->/** @scrutinizer ignore-call */
setNumber1(1);
$this->assertEquals(['call', 'setNumber1', [1], $proxied], end($handler->calls));