Mygento_Geoip_Test_Config_Base::testModelAlias()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
/**
4
 *
5
 *
6
 * @category Mygento
7
 * @package Mygento_Geoip
8
 * @copyright Copyright © 2015 NKS LLC. (http://www.mygento.ru)
9
 */
10
class Mygento_Geoip_Test_Config_Base extends EcomDev_PHPUnit_Test_Case_Config
11
{
12
13
    /**
14
     * @test
15
     */
16
    public function testValidCodepool()
17
    {
18
        $this->assertModuleCodePool('community');
19
    }
20
21
    /**
22
     * @test
23
     */
24
    public function testBlockAlias()
25
    {
26
        $this->assertBlockAlias('geoip/version', 'Mygento_Geoip_Block_Version');
27
    }
28
29
    /**
30
     * @test
31
     */
32
    public function testModelAlias()
33
    {
34
        $this->assertModelAlias('geoip/city', 'Mygento_Geoip_Model_City');
35
        $this->assertModelAlias('geoip/country', 'Mygento_Geoip_Model_Country');
36
        $this->assertModelAlias('geoip/info', 'Mygento_Geoip_Model_Info');
37
    }
38
39
    /**
40
     * @test
41
     */
42
    public function testConfig()
43
    {
44
        $this->assertConfigNodeHasChild('global/helpers', 'geoip');
45
        $this->assertConfigNodeValue('global/helpers/geoip/class', 'Mygento_Geoip_Helper');
46
        $this->assertConfigNodeHasChild('global/models', 'geoip');
47
        $this->assertConfigNodeValue('global/models/geoip/class', 'Mygento_Geoip_Model');
48
        $this->assertConfigNodeHasChild('global/blocks', 'geoip');
49
        $this->assertConfigNodeValue('global/blocks/geoip/class', 'Mygento_Geoip_Block');
50
    }
51
52
    /**
53
     * @test
54
     */
55
    public function testDefaults()
56
    {
57
        // the module namespace
58
        $this->assertConfigNodeHasChild('default', 'geoip');
59
60
        // general presets
61
        $this->assertConfigNodeHasChild('default/geoip', 'general');
62
        $this->assertConfigNodeHasChild('default/geoip/general', 'enabled');
63
        $this->assertConfigNodeHasChild('default/geoip/general', 'layout');
64
        $this->assertConfigNodeHasChild('default/geoip/general', 'city');
65
        $this->assertConfigNodeHasChild('default/geoip/general', 'country');
66
67
        $this->assertEquals("0", Mage::getStoreConfig('geoip/general/enabled'));
68
        $this->assertEquals("1", Mage::getStoreConfig('geoip/general/layout'));
69
    }
70
71
    /**
72
     * @test
73
     */
74
    public function testModelResourceAlias()
75
    {
76
        //$this->assertResourceModelAlias('geoip/job', 'Mygento_Geoip_Model_Resource_Job');
77
    }
78
79
    /**
80
     * @test
81
     */
82
    public function testHelperAlias()
83
    {
84
        $this->assertHelperAlias('geoip', 'Mygento_Geoip_Helper_Data');
85
    }
86
87
    /**
88
     * @test
89
     */
90
    public function testEvent()
91
    {
92
    }
93
94
    /**
95
     * @test
96
     */
97
    public function testLayout()
98
    {
99
        $this->assertLayoutFileDefined('frontend', 'mygento/geoip.xml');
100
        $this->assertLayoutFileExists('frontend', 'mygento/geoip.xml');
101
    }
102
}
103