Completed
Push — master ( c24d4c...96117c )
by Sven
02:34
created

SingletonTraitTest::testTrait()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.6666
c 0
b 0
f 0
cc 1
eloc 6
nc 1
nop 0
1
<?php
2
namespace Bedd\Common\Traits;
3
4
class TestClassA
5
{
6
    use SingletonTrait;
7
}
8
class TestClassB
9
{
10
    use SingletonTrait;
11
}
12
/**
13
 * SingletonTraitTest
14
 */
15
class SingletonTraitTest extends \PHPUnit_Framework_TestCase
16
{
17
    /**
18
     * Test for Bedd\Common\Utils\SingletonTrait
19
     */
20
    public function testTrait()
21
    {
22
        $a1 = TestClassA::getInstance();
23
        $a2 = TestClassA::getInstance();
24
        $b1 = TestClassB::getInstance();
25
26
        $this->assertEquals($a1, $a2);
27
        $this->assertNotEquals($a1, $b1);
28
    }
29
}
30