NotificationTest::testType()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 7
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 7
loc 7
rs 9.4285
cc 1
eloc 5
nc 1
nop 0
1
<?php
2
namespace Wonnova\SDK\Test\Model;
3
4
use PHPUnit_Framework_TestCase as TestCase;
5
use Wonnova\SDK\Model\Achievement;
6
use Wonnova\SDK\Model\Notification;
7
8 View Code Duplication
class NotificationTest extends TestCase
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
9
{
10
    /**
11
     * @var Notification
12
     */
13
    private $notification;
14
15
    public function setUp()
16
    {
17
        $this->notification = new Notification();
18
    }
19
20
    public function testType()
21
    {
22
        $expected = Achievement::TYPE_BADGE;
23
        $this->assertNull($this->notification->getType());
24
        $this->assertSame($this->notification, $this->notification->setType($expected));
25
        $this->assertEquals($expected, $this->notification->getType());
26
    }
27
28
    public function testMessage()
29
    {
30
        $expected = 'Congratulations!! You have won a badge!!';
31
        $this->assertNull($this->notification->getMessage());
32
        $this->assertSame($this->notification, $this->notification->setMessage($expected));
33
        $this->assertEquals($expected, $this->notification->getMessage());
34
    }
35
}
36