@@ -61,4 +61,53 @@ public function testIsEnabled()
61
61
$ this ->assertTrue ($ this ->_model ->isEnabled ('Module_Exists ' ));
62
62
$ this ->assertFalse ($ this ->_model ->isEnabled ('Module_NotExists ' ));
63
63
}
64
+
65
+ public function testIsOutputEnabledReturnsFalseForDisabledModule ()
66
+ {
67
+ $ this ->_outputConfig ->expects ($ this ->any ())->method ('isSetFlag ' )->will ($ this ->returnValue (true ));
68
+ $ this ->assertFalse ($ this ->_model ->isOutputEnabled ('Disabled_Module ' ));
69
+ }
70
+
71
+ /**
72
+ * @param bool $configValue
73
+ * @param bool $expectedResult
74
+ * @dataProvider isOutputEnabledGenericConfigPathDataProvider
75
+ */
76
+ public function testIsOutputEnabledGenericConfigPath ($ configValue , $ expectedResult )
77
+ {
78
+ $ this ->_moduleList ->expects ($ this ->once ())->method ('has ' )->will ($ this ->returnValue (true ));
79
+ $ this ->_outputConfig ->expects ($ this ->once ())
80
+ ->method ('isEnabled ' )
81
+ ->with ('Module_One ' )
82
+ ->will ($ this ->returnValue ($ configValue ));
83
+ $ this ->assertEquals ($ expectedResult , $ this ->_model ->isOutputEnabled ('Module_One ' ));
84
+ }
85
+
86
+ public function isOutputEnabledGenericConfigPathDataProvider ()
87
+ {
88
+ return ['output disabled ' => [true , false ], 'output enabled ' => [false , true ]];
89
+ }
90
+
91
+ /**
92
+ * @param bool $configValue
93
+ * @param bool $expectedResult
94
+ * @dataProvider isOutputEnabledCustomConfigPathDataProvider
95
+ */
96
+ public function testIsOutputEnabledCustomConfigPath ($ configValue , $ expectedResult )
97
+ {
98
+ $ this ->_moduleList ->expects ($ this ->once ())->method ('has ' )->will ($ this ->returnValue (true ));
99
+ $ this ->_outputConfig ->expects ($ this ->at (0 ))
100
+ ->method ('isSetFlag ' )
101
+ ->with (self ::XML_PATH_OUTPUT_ENABLED )
102
+ ->will ($ this ->returnValue ($ configValue ));
103
+ $ this ->assertEquals ($ expectedResult , $ this ->_model ->isOutputEnabled ('Module_Two ' ));
104
+ }
105
+
106
+ public function isOutputEnabledCustomConfigPathDataProvider ()
107
+ {
108
+ return [
109
+ 'path literal, output disabled ' => [false , false ],
110
+ 'path literal, output enabled ' => [true , true ],
111
+ ];
112
+ }
64
113
}
0 commit comments