Completed
Push — feat/add-quality-gates ( b24265...ab5d16 )
by Guillem
02:59
created

DecoderUtilsTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 5
dl 0
loc 19
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testExtractFormatFromContentType() 0 3 1
A dataForExtractFormatFromContentType() 0 5 1
1
<?php
2
3
namespace ElevenLabs\Api\Decoder;
4
5
use PHPUnit\Framework\TestCase;
6
7
/**
8
 * Class DecoderUtilsTest
9
 *
10
 * @package Decoder
11
 */
12
class DecoderUtilsTest extends TestCase
13
{
14
    /**
15
     * @dataProvider dataForExtractFormatFromContentType
16
     * @param $contentType
17
     */
18
    public function testExtractFormatFromContentType($contentType, $format)
19
    {
20
        self::assertEquals($format, DecoderUtils::extractFormatFromContentType($contentType));
21
    }
22
23
    /**
24
     * @return array
25
     */
26
    public function dataForExtractFormatFromContentType()
27
    {
28
        return [
29
            ['text/plain', 'plain'],
30
            ['application/xhtml+xml', 'xml']
31
        ];
32
    }
33
}
34