SelfRecipientTest   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 1
dl 0
loc 29
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 4 1
A testValidatedBy() 0 4 1
A testTargets() 0 4 1
A testMessage() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the MilioooMessageBundle package.
5
 *
6
 * (c) Michiel boeckaert <[email protected]>
7
 * This source file is subject to the MIT license that is bundled
8
 * with this source code in the file LICENSE.
9
 */
10
11
namespace Miliooo\MessagingBundle\Tests\Validator\Constraint;
12
13
use Miliooo\MessagingBundle\Validator\Constraint\SelfRecipient;
14
15
/**
16
 * Test file for SelfRecipient
17
 *
18
 * @author Michiel Boeckaert <[email protected]>
19
 */
20
class SelfRecipientTest extends \PHPUnit_Framework_TestCase
21
{
22
    /**
23
     * Class under test
24
     *
25
     * @var SelfRecipient
26
     */
27
    private $selfRecipient;
28
29
    public function setUp()
30
    {
31
        $this->selfRecipient = new SelfRecipient();
32
    }
33
34
    public function testValidatedBy()
35
    {
36
        $this->assertSame('miliooo_messaging.validator.self_recipient', $this->selfRecipient->validatedBy());
37
    }
38
39
    public function testTargets()
40
    {
41
        $this->assertSame(SelfRecipient::PROPERTY_CONSTRAINT, $this->selfRecipient->getTargets());
42
    }
43
44
    public function testMessage()
45
    {
46
        $this->assertAttributeEquals('validate.author_not_recipient', 'message', $this->selfRecipient);
47
    }
48
}
49