GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

TextPreserverTest::tearDown()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
/*
3
 * This file is part of the trefoil application.
4
 *
5
 * (c) Miguel Angel Gabriel <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Trefoil\Helpers;
12
13
/**
14
 * Generated by PHPUnit_SkeletonGenerator 1.2.1 on 2013-12-31 at 09:17:37.
15
 */
16
class TextPreserverTest extends \PHPUnit_Framework_TestCase
17
{
18
19
    /**
20
     * @var TextPreserver
21
     */
22
    protected $object;
23
24
    /**
25
     * Sets up the fixture, for example, opens a network connection.
26
     * This method is called before a test is executed.
27
     */
28
    protected function setUp()
29
    {
30
        $this->object = new TextPreserver;
31
    }
32
33
    /**
34
     * Tears down the fixture, for example, closes a network connection.
35
     * This method is called after a test is executed.
36
     */
37
    protected function tearDown()
38
    {
39
40
    }
41
42
    /**
43
     * @covers Trefoil\Helpers\TextPreserver::setText
44
     * @covers Trefoil\Helpers\TextPreserver::getText
45
     */
46
    public function testNoChange()
47
    {
48
        $this->object->setText('Lorem ipsum');
49
        $this->assertEquals('Lorem ipsum', $this->object->getText());
50
    }
51
52
    /**
53
     * @covers Trefoil\Helpers\TextPreserver::preserveHtmlTags
54
     * @covers Trefoil\Helpers\TextPreserver::restore
55
     */
56 View Code Duplication
    public function testPreserveHtmlTags()
57
    {
58
        $html = '<div class="myclass">';
59
        $html .= '<a href="http://example.com/image.gif">Lorem ipsum</a>';
60
        $html .= '</div>';
61
62
        $this->object->setText($html);
63
        $this->object->preserveHtmlTags(array('a'));
64
65
        $this->assertNotEquals($html, $this->object->getText());
66
67
        $this->object->restore();
68
        $this->assertEquals($html, $this->object->getText());
69
    }
70
71
    /**
72
     * @covers Trefoil\Helpers\TextPreserver::preserveHtmlTagAttributes
73
     * @covers Trefoil\Helpers\TextPreserver::restore
74
     */
75 View Code Duplication
    public function testPreserveHtmlTagAttributes()
76
    {
77
        $html = '<div class="myclass">';
78
        $html .= '<a href="http://example.com/image.gif">Lorem ipsum</a>';
79
        $html .= '</div>';
80
81
        $this->object->setText($html);
82
        $this->object->preserveHtmlTagAttributes(array('href', 'class'));
83
84
        $this->assertNotEquals($html, $this->object->getText());
85
86
        $this->object->restore();
87
        $this->assertEquals($html, $this->object->getText());
88
    }
89
90
    /**
91
     * @covers Trefoil\Helpers\TextPreserver::internalCreatePlacehoder
92
     */
93
    public function testCreatePlacehoder()
94
    {
95
        $value = 'myvalue';
96
        $placeholder = $this->object->internalCreatePlacehoder($value, 'prefix');
97
98
        $html = '<div class="myclass">' . $value . '</div>';
99
        $html2 = str_replace('myvalue', $placeholder, $html);
100
101
        $this->object->setText($html2);
102
        $this->assertEquals($html2, $this->object->getText());
103
104
        $this->object->restore();
105
        $this->assertEquals($html, $this->object->getText());
106
    }
107
108
}
109