Code Duplication    Length = 20-20 lines in 3 locations

tests/BugherdHeroToolTest.php 3 locations

@@ 40-59 (lines=20) @@
37
    /**
38
     * Test checks if the bugherd template can be found in the template implementation
39
     */
40
    public function testModusDevNoMember()
41
    {
42
        Config::inst()->update('BugherdHeroTool', 'environment_type', 'dev');
43
        Config::inst()->update('Director', 'environment_type', 'dev');
44
        Config::inst()->update('BugherdHeroTool', 'project_key', 'xxxx');
45
46
        $response = $this->get($this->objFromFixture('Page', 'home')->Link());
47
        $body = strpos($response->getBody(), $this->bugherd_string);
48
        $this->assertTrue(is_numeric($body), _t('BugherdHeroToolTest.CantFindInTemplate').vsprintf(_t('BugherdHeroToolTest.ModeTestedMode'), array('dev', 'dev')));
49
50
        Config::inst()->update('Director', 'environment_type', 'test');
51
        $response = $this->get($this->objFromFixture('Page', 'home')->Link());
52
        $body = strpos($response->getBody(), $this->bugherd_string);
53
        $this->assertFalse($body, _t('BugherdHeroToolTest.FindInTemplate').vsprintf(_t('BugherdHeroToolTest.ModeTestedMode'), array('dev', 'test')));
54
55
        Config::inst()->update('Director', 'environment_type', 'live');
56
        $response = $this->get($this->objFromFixture('Page', 'home')->Link());
57
        $body = strpos($response->getBody(), $this->bugherd_string);
58
        $this->assertFalse($body, _t('BugherdHeroToolTest.FindInTemplate').vsprintf(_t('BugherdHeroToolTest.ModeTestedMode'), array('dev', 'live')));
59
    }
60
61
    public function testModusTestNoMember()
62
    {
@@ 61-80 (lines=20) @@
58
        $this->assertFalse($body, _t('BugherdHeroToolTest.FindInTemplate').vsprintf(_t('BugherdHeroToolTest.ModeTestedMode'), array('dev', 'live')));
59
    }
60
61
    public function testModusTestNoMember()
62
    {
63
        Config::inst()->update('BugherdHeroTool', 'environment_type', 'test');
64
        Config::inst()->update('Director', 'environment_type', 'test');
65
        Config::inst()->update('BugherdHeroTool', 'project_key', 'xxxx');
66
67
        $response = $this->get($this->objFromFixture('Page', 'home')->Link());
68
        $body = strpos($response->getBody(), $this->bugherd_string);
69
        $this->assertTrue(is_numeric($body), _t('BugherdHeroToolTest.CantFindInTemplate').vsprintf(_t('BugherdHeroToolTest.ModeTestedMode'), array('test', 'test')));
70
71
        Config::inst()->update('Director', 'environment_type', 'dev');
72
        $response = $this->get($this->objFromFixture('Page', 'home')->Link());
73
        $body = strpos($response->getBody(), $this->bugherd_string);
74
        $this->assertFalse($body, _t('BugherdHeroToolTest.FindInTemplate').vsprintf(_t('BugherdHeroToolTest.ModeTestedMode'), array('test', 'dev')));
75
76
        Config::inst()->update('Director', 'environment_type', 'live');
77
        $response = $this->get($this->objFromFixture('Page', 'home')->Link());
78
        $body = strpos($response->getBody(), $this->bugherd_string);
79
        $this->assertFalse($body, _t('BugherdHeroToolTest.FindInTemplate').vsprintf(_t('BugherdHeroToolTest.ModeTestedMode'), array('test', 'live')));
80
    }
81
82
    public function testModusLiveNoMember()
83
    {
@@ 82-101 (lines=20) @@
79
        $this->assertFalse($body, _t('BugherdHeroToolTest.FindInTemplate').vsprintf(_t('BugherdHeroToolTest.ModeTestedMode'), array('test', 'live')));
80
    }
81
82
    public function testModusLiveNoMember()
83
    {
84
        Config::inst()->update('BugherdHeroTool', 'environment_type', 'live');
85
        Config::inst()->update('Director', 'environment_type', 'live');
86
        Config::inst()->update('BugherdHeroTool', 'project_key', 'xxxx');
87
88
        $response = $this->get($this->objFromFixture('Page', 'home')->Link());
89
        $body = strpos($response->getBody(), $this->bugherd_string);
90
        $this->assertTrue(is_numeric($body), _t('BugherdHeroToolTest.CantFindInTemplate').vsprintf(_t('BugherdHeroToolTest.ModeTestedMode'), array('live', 'live')));
91
92
        Config::inst()->update('Director', 'environment_type', 'dev');
93
        $response = $this->get($this->objFromFixture('Page', 'home')->Link());
94
        $body = strpos($response->getBody(), $this->bugherd_string);
95
        $this->assertFalse($body, _t('BugherdHeroToolTest.FindInTemplate').vsprintf(_t('BugherdHeroToolTest.ModeTestedMode'), array('live', 'dev')));
96
97
        Config::inst()->update('Director', 'environment_type', 'test');
98
        $response = $this->get($this->objFromFixture('Page', 'home')->Link());
99
        $body = strpos($response->getBody(), $this->bugherd_string);
100
        $this->assertFalse($body, _t('BugherdHeroToolTest.FindInTemplate').vsprintf(_t('BugherdHeroToolTest.ModeTestedMode'), array('live', 'test')));
101
    }
102
}
103