Completed
Pull Request — develop (#27)
by Chris
02:25
created

ByterangeTranformerTest::dataProvider()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 19
Code Lines 12

Duplication

Lines 19
Ratio 100 %

Importance

Changes 0
Metric Value
dl 19
loc 19
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 12
nc 1
nop 0
1
<?php
2
3
namespace Chrisyue\PhpM3u8\Tests\M3u8\Transformer;
4
5
use Chrisyue\PhpM3u8\Document\Rfc8216\Tag;
6
use PHPUnit\Framework\TestCase;
7
use Chrisyue\PhpM3u8\Transformer\ByterangeTransformer;
8
9
class ByterangeTranformerTest extends TestCase
10
{
11
    /**
12
     * @dataProvider dataProvider
13
     */
14
    public function testTransform($origin, $transformed)
15
    {
16
        $transformer = new ByterangeTransformer();
17
18
        $this->assertEquals($transformed, $transformer->transform($origin));
19
    }
20
21 View Code Duplication
    public function dataProvider()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
22
    {
23
        $data = [];
24
25
        $origin = '100';
26
        $transformed = new Tag\Byterange();
27
        $transformed->length = 100;
28
29
        $data[] = [$origin, $transformed];
30
31
        $origin = '222@333';
32
        $transformed = new Tag\Byterange();
33
        $transformed->length = 222;
34
        $transformed->offset = 333;
35
36
        $data[] = [$origin, $transformed];
37
38
        return $data;
39
    }
40
}
41