Passed
Push — master ( 622b59...5d7ead )
by NexusLink
02:28
created

LinkPurifierTest::linkPurifyTest()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 7
Ratio 100 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 7
loc 7
rs 9.4285
cc 1
eloc 5
nc 1
nop 0
1
<?php
2
3
namespace ExternalLinkPurifier\Tests;
4
5
use ExternalLinkPurifier\LinkPurifier;
6
7
class LinkPurifierTest extends \PHPUnit_Framework_TestCase {
8
    
9
    /**
10
     * @test
11
     */
12 View Code Duplication
    public function linkPurifyTest()
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...
13
    {
14
        $linkPurifier = new LinkPurifier('');
15
        $output = $linkPurifier->Purify('Lorem Ipsum <a href="http://www.google.co.in" target="_blank">http://www.google.co.in</a> lorem ipsum dummy text added for the testing purpose');        
16
        $expectedOutPut = 'Lorem Ipsum  lorem ipsum dummy text added for the testing purpose';
17
        $this->assertEquals($expectedOutPut, $output);
18
    }
19
    
20
    /**
21
     * @test
22
     */
23 View Code Duplication
    public function linkPurifyExceptDomainTest()
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...
24
    {
25
        $linkPurifier = new LinkPurifier('');
26
        $output = $linkPurifier->Purify('Lorem Ipsum <a href="http://www.google.co.in" target="_blank">http://www.google.co.in</a> lorem ipsum dummy text added for the testing purpose by <a href="http://www.mywebsite.co.in">http://www.mywebsite.co.in</a>', 'mywebsite');        
27
        $expectedOutPut = 'Lorem Ipsum  lorem ipsum dummy text added for the testing purpose by <a href="http://www.mywebsite.co.in">http://www.mywebsite.co.in</a>';
28
        $this->assertEquals($expectedOutPut, $output);
29
    }
30
}
31