Passed
Pull Request — master (#2)
by Alexander
01:11
created

ProxyContainerTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 8
c 1
b 0
f 0
dl 0
loc 14
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A testProxied() 0 12 1
1
<?php
2
3
4
namespace Yiisoft\Proxy\Tests;
5
6
7
use PHPUnit\Framework\TestCase;
8
use Yiisoft\Proxy\ProxyContainer;
9
10
final class ProxyContainerTest extends TestCase
11
{
12
    public function testProxied(): void
13
    {
14
        $container = new DummyContainer();
15
        $proxied = $container->get(Proxied::class);
16
17
        $handler = new ProxyHandler();
18
19
        $proxyContainer = new ProxyContainer($container, $handler);
20
        $proxy = $proxyContainer->get(Proxied::class);
21
        $proxy->setNumber1(1);
0 ignored issues
show
Bug introduced by
The method setNumber1() does not exist on Yiisoft\Proxy\Proxy. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

21
        $proxy->/** @scrutinizer ignore-call */ 
22
                setNumber1(1);
Loading history...
22
23
        $this->assertEquals(['call', 'setNumber1', [1], $proxied], end($handler->calls));
24
    }
25
}
26