VoiceTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testAccessors() 0 16 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 PHPUnit\Framework\TestCase;
16
use TelegramBotAPI\Types\Voice;
17
18
/**
19
 * Class VoiceTest
20
 * @package TelegramBotAPI\Tests\Types
21
 * @author Roma Baranenko <[email protected]>
22
 */
23
class VoiceTest extends TestCase {
24
25
    public function testAccessors() {
26
27
        $obj = new Voice();
28
29
        $obj->setFileId('file_id');
30
        $obj->setFileSize(123);
31
        $obj->setMimeType(Constants::APPLICATION_PDF_MIME_TYPE);
32
        $obj->setDuration(3);
33
34
        $this->assertEquals('file_id', $obj->getFileId());
35
        $this->assertEquals(123, $obj->getFileSize());
36
        $this->assertEquals(Constants::APPLICATION_PDF_MIME_TYPE, $obj->getMimeType());
37
        $this->assertEquals(3, $obj->getDuration());
38
39
        $this->assertJson(json_encode($obj));
40
    }
41
}
42