Skip to content

Commit

Permalink
More tests for Audio
Browse files Browse the repository at this point in the history
  • Loading branch information
iGusev committed Sep 16, 2015
1 parent 9b099cd commit 7512f02
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions tests/AudioTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,34 @@ public function testGetDuration()
$this->assertEquals(1, $item->getDuration());
}

public function testSetPerformer()
{
$item = new Audio();
$item->setPerformer('test');
$this->assertAttributeEquals('test', 'performer', $item);
}

public function testGetPerformer()
{
$item = new Audio();
$item->setPerformer('test');
$this->assertEquals('test', $item->getPerformer());
}

public function testSetTitle()
{
$item = new Audio();
$item->setTitle('test');
$this->assertAttributeEquals('test', 'title', $item);
}

public function testGetTitle()
{
$item = new Audio();
$item->setTitle('test');
$this->assertEquals('test', $item->getTitle());
}

public function testSetFileSize()
{
$item = new Audio();
Expand Down Expand Up @@ -67,12 +95,16 @@ public function testFromResponse()
$item = Audio::fromResponse(array(
'file_id' => 'testFileId1',
'duration' => 1,
'performer' => 'testperformer',
'title' => 'testtitle',
'mime_type' => 'audio/mp3',
'file_size' => 3
));
$this->assertInstanceOf('\TelegramBot\Api\Types\Audio', $item);
$this->assertAttributeEquals('testFileId1', 'fileId', $item);
$this->assertAttributeEquals(1, 'duration', $item);
$this->assertAttributeEquals('testperformer', 'performer', $item);
$this->assertAttributeEquals('testtitle', 'title', $item);
$this->assertAttributeEquals('audio/mp3', 'mimeType', $item);
$this->assertAttributeEquals(3, 'fileSize', $item);
}
Expand Down

0 comments on commit 7512f02

Please sign in to comment.