Completed
Push — master ( 3338f6...2ff2f4 )
by Aydin
02:03
created

TcpSocketFactoryTest::testCreateClient()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 8
rs 9.4286
cc 1
eloc 5
nc 1
nop 0
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