SingletonTraitTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 15
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testTrait() 0 9 1
1
<?php
2
namespace Bedd\Common\Traits;
3
4
use Bedd\Common\TestCase;
5
6
class TestClassA
7
{
8
    use SingletonTrait;
9
}
10
class TestClassB
11
{
12
    use SingletonTrait;
13
}
14
/**
15
 * SingletonTraitTest
16
 */
17
class SingletonTraitTest extends TestCase
18
{
19
    /**
20
     * Test for Bedd\Common\Utils\SingletonTrait
21
     */
22
    public function testTrait()
23
    {
24
        $a1 = TestClassA::getInstance();
25
        $a2 = TestClassA::getInstance();
26
        $b1 = TestClassB::getInstance();
27
28
        $this->assertEquals($a1, $a2);
29
        $this->assertNotEquals($a1, $b1);
30
    }
31
}
32