Mp3Parser::setUp()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the Stinger Media Parser package.
5
 *
6
 * (c) Oliver Kotte <[email protected]>
7
 * (c) Florian Meyer <[email protected]>
8
 *
9
 * For the full copyright and license information, please view the LICENSE
10
 * file that was distributed with this source code.
11
 */
12
13
namespace StingerSoft\MediaParsingBundle\Tests\Parser\Types;
14
15
use StingerSoft\MediaParsingBundle\Tests\TestCase;
16
use Symfony\Component\HttpFoundation\File\File;
17
use StingerSoft\MediaParsingBundle\Parser\MediaParserInterface;
18
19
20
class Mp3Parser extends TestCase {
21
	
22
	/**
23
	 * 
24
	 * @var MediaParserInterface
25
	 */
26
	protected $parser;
27
	
28
	public function setUp(){
29
		$this->parser = $this->createContainer()->get('stinger_soft_media_parser.media_parser.mp3');
30
	}
31
	
32
	public function testService(){
33
		$this->assertInstanceOf('StingerSoft\MediaParsingBundle\Parser\Types\Mp3Parser', $this->parser);
34
	}
35
	
36
	public function testParsing(){
37
		$file = new File(__DIR__.'/../../Fixtures/test.mp3');
38
		$info = $this->parser->parseFile($file);
39
		
40
		$this->assertInstanceOf('StingerSoft\MediaParsingBundle\Parser\Information\SongInformationInterface', $info);
41
	}
42
	
43
44
	public function testNoMp3Parsing(){
45
		$this->setExpectedException('RuntimeException');
46
		$file = new File(__DIR__.'/../../Fixtures/no-mp3.mp3');
47
		$this->parser->parseFile($file);
48
	}
49
50
}