SoapTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 23
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testCanBuildAdapterWithSoapRpcClient() 0 14 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ProxyManagerTest\Factory\RemoteObject\Adapter;
6
7
use Laminas\Server\Client;
8
use PHPUnit\Framework\MockObject\MockObject;
9
use PHPUnit\Framework\TestCase;
10
use ProxyManager\Factory\RemoteObject\Adapter\Soap;
11
12
/**
13
 * Tests for {@see \ProxyManager\Factory\RemoteObject\Adapter\Soap}
14
 *
15
 * @group Coverage
16
 */
17
final class SoapTest extends TestCase
18
{
19
    /**
20
     * {@inheritDoc}
21
     *
22
     * @covers \ProxyManager\Factory\RemoteObject\Adapter\Soap::__construct
23
     * @covers \ProxyManager\Factory\RemoteObject\Adapter\Soap::getServiceName
24
     */
25
    public function testCanBuildAdapterWithSoapRpcClient() : void
26
    {
27
        $client = $this->getMockBuilder(Client::class)->setMethods(['call'])->getMock();
0 ignored issues
show
Bug introduced by
The method setMethods cannot be called on $this->getMockBuilder(\L...s\Server\Client::class) (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
28
29
        $adapter = new Soap($client);
30
31
        $client
32
            ->expects(self::once())
0 ignored issues
show
Bug introduced by
The method once() does not seem to exist on object<ProxyManagerTest\...bject\Adapter\SoapTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
33
            ->method('call')
34
            ->with('bar', ['tab' => 'taz'])
35
            ->willReturn('baz');
36
37
        self::assertSame('baz', $adapter->call('foo', 'bar', ['tab' => 'taz']));
0 ignored issues
show
Bug introduced by
The method assertSame() does not seem to exist on object<ProxyManagerTest\...bject\Adapter\SoapTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
38
    }
39
}
40