AudioTest::testAccessors()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 20
Code Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 20
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 15
nc 1
nop 0
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