Passed
Push — master ( 8edc98...b49f83 )
by Jean Paul
01:26
created

MySqlConnectorTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 11
c 1
b 0
f 0
dl 0
loc 30
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testSetGetUnixSocket() 0 10 1
A testSetGetCharset() 0 10 1
1
<?php
2
3
namespace Coco\SourceWatcher\Tests\Core\Database\Connections;
4
5
use Coco\SourceWatcher\Core\Database\Connections\MySqlConnector;
6
use PHPUnit\Framework\TestCase;
7
8
/**
9
 * Class MySqlConnectorTest
10
 * @package Coco\SourceWatcher\Tests\Core\Database\Connections
11
 */
12
class MySqlConnectorTest extends TestCase
13
{
14
    /**
15
     *
16
     */
17
    public function testSetGetUnixSocket () : void
18
    {
19
        $connector = new MySqlConnector();
20
21
        $given = "/var/run/mysqld/mysqld.sock";
22
        $expected = "/var/run/mysqld/mysqld.sock";
23
24
        $connector->setUnixSocket( $given );
25
26
        $this->assertEquals( $expected, $connector->getUnixSocket() );
27
    }
28
29
    /**
30
     *
31
     */
32
    public function testSetGetCharset () : void
33
    {
34
        $connector = new MySqlConnector();
35
36
        $given = "utf8";
37
        $expected = "utf8";
38
39
        $connector->setCharset( $given );
40
41
        $this->assertEquals( $expected, $connector->getCharset() );
42
    }
43
}
44