TcpSocketFactoryTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testCreateClient() 0 8 1
1
<?php
2
3
namespace PhpSchool\LearnYouPhpTest;
4
5
use Hoa\Socket\Client;
6
use PhpSchool\LearnYouPhp\TcpSocketFactory;
7
use PHPUnit_Framework_TestCase;
8
9
/**
10
 * Class TcpSocketFactoryTest
11
 * @author Aydin Hassan <[email protected]>
12
 */
13
class TcpSocketFactoryTest extends PHPUnit_Framework_TestCase
14
{
15
    public function testCreateClient()
16
    {
17
        $factory = new TcpSocketFactory;
18
        $client = $factory->createClient('127.0.0.1', 65000);
19
        
20
        $this->assertInstanceOf(Client::class, $client);
21
        $this->assertSame('tcp://127.0.0.1:65000', $client->getSocket()->__toString());
22
    }
23
}
24