AudioTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testAccessors() 0 20 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * Team: jungle
5
 * User: Roma Baranenko
6
 * Contacts: <[email protected]>
7
 * Date: 05.12.17
8
 * Time: 18:50
9
 */
10
11
namespace TelegramBotAPI\Tests\Types;
12
13
14
use TelegramBotAPI\Constants;
15
use TelegramBotAPI\Types\Audio;
16
use PHPUnit\Framework\TestCase;
17
18
/**
19
 * Class AudioTest
20
 * @package TelegramBotAPI\Tests\Types
21
 * @author Roma Baranenko <[email protected]>
22
 */
23
class AudioTest extends TestCase {
24
25
    public function testAccessors() {
26
27
        $obj = new Audio();
28
29
        $obj->setFileId('file_id');
30
        $obj->setFileSize(123);
31
        $obj->setTitle('title');
32
        $obj->setPerformer('performer');
33
        $obj->setDuration(1);
34
        $obj->setMimeType(Constants::APPLICATION_ZIP_MIME_TYPE);
35
36
        $this->assertEquals('file_id', $obj->getFileId());
37
        $this->assertEquals(123, $obj->getFileSize());
38
        $this->assertEquals('title', $obj->getTitle());
39
        $this->assertEquals('performer', $obj->getPerformer());
40
        $this->assertEquals(1, $obj->getDuration());
41
        $this->assertEquals(Constants::APPLICATION_ZIP_MIME_TYPE, $obj->getMimeType());
42
43
        $this->assertJson(json_encode($obj));
44
    }
45
}
46