MediaAssetsFinderTest::assetsMediaFilterTest()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 9
rs 9.6666
cc 1
eloc 5
nc 1
nop 0
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