MagicAccessorTraitTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A magicGet() 0 5 1
A magicSet() 0 6 1
1
<?php
2
namespace SubjectivePHPTest\Spl\Traits;
3
4
/**
5
 * @coversDefaultClass SubjectivePHP\Spl\Traits\MagicAccessorTrait
6
 */
7
class MagicAccessorTraitTest extends \PHPUnit\Framework\TestCase
8
{
9
    /**
10
     * Verify basic behavior of __get().
11
     *
12
     * @test
13
     * @covers ::__get
14
     *
15
     * @return void
16
     */
17
    public function magicGet()
18
    {
19
        $object = new SimpleObject(['foo' => 'bar']);
20
        $this->assertSame('bar', $object->foo);
21
    }
22
23
    /**
24
     * Verify basic behavior of getDirectory().
25
     *
26
     * @test
27
     * @covers ::__set
28
     *
29
     * @return void
30
     */
31
    public function magicSet()
32
    {
33
        $object = new SimpleObject();
34
        $object->foo = 'bar';
35
        $this->assertSame(['foo' => 'bar'], $object->getContainer());
36
    }
37
}
38