EventArgsTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 19
rs 10
c 1
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testGetInvoker() 0 9 1
A testGetData() 0 6 1
1
<?php
2
3
namespace CouchDB\Tests\Events;
4
5
use CouchDB\Events\EventArgs;
6
use CouchDB\Tests\TestCase;
7
8
/**
9
 * @author Markus Bachmann <[email protected]>
10
 */
11
class EventArgsTest extends TestCase
12
{
13
    public function testGetInvoker()
14
    {
15
        $invoker = new Dummy();
16
        $args = new EventArgs($invoker);
17
        $this->assertEquals($invoker, $args->getInvoker());
18
        $this->assertEquals('bar', $args->getInvoker()->foo);
19
        $invoker->foo = 'foobar';
20
        $this->assertEquals('foobar', $args->getInvoker()->foo);
21
    }
22
23
    public function testGetData()
24
    {
25
        $data = 'foo';
26
        $args = new EventArgs(new Dummy(), $data);
27
        $this->assertEquals('foo', $args->getData());
28
    }
29
}
30
31
class Dummy
32
{
33
    public $foo = 'bar';
34
}
35