MediaAssetsFinderTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 2
dl 0
loc 16
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A assetsMediaFilterTest() 0 9 1
1
<?php
2
3
namespace AssetsFinder\Tests\src\Services;
4
5
use AssetsFinder\src\Services\MediaAssetsFinder;
6
7
class MediaAssetsFinderTest extends \PHPUnit_Framework_TestCase
8
{
9
    /**
10
     * @test
11
     */
12
    public function assetsMediaFilterTest() 
13
    {
14
        $content = "this is a example first file http://www.mywebsite.com/sample.mp3 and second file is https://www.mywebsite.com/sample.mp4. This is the image link <img src='http://www.mywebsite.com/assets/images/testimage.jpg' alt='test image' title='test image'> and second image <img src='http://www.mywebsite.com/assets/images/testimage2.png' alt='test png image' title='test png image'>";
15
        
16
        $actualResult = MediaAssetsFinder::assetsFilter($content, 'mp4');
17
        $expectedResult = array('0' => 'https://www.mywebsite.com/sample.mp4');
18
        
19
        $this->assertEquals($expectedResult, $actualResult);
20
    }
21
22
}
23