File tree Expand file tree Collapse file tree 1 file changed +11
-12
lines changed
app/code/Magento/Contact/Test/Unit/Model Expand file tree Collapse file tree 1 file changed +11
-12
lines changed Original file line number Diff line number Diff line change @@ -54,30 +54,29 @@ protected function setUp(): void
54
54
* Test isEnabled()
55
55
*
56
56
* @return void
57
+ * @dataProvider isEnabledDataProvider
57
58
*/
58
- public function testIsEnabled (): void
59
+ public function testIsEnabled ($ isSetFlag , $ result ): void
59
60
{
60
61
$ this ->scopeConfigMock ->expects ($ this ->once ())
61
62
->method ('isSetFlag ' )
62
63
->with (config::XML_PATH_ENABLED , ScopeInterface::SCOPE_STORE )
63
- ->willReturn (true );
64
+ ->willReturn ($ isSetFlag );
64
65
65
- $ this ->assertTrue ( $ this ->model ->isEnabled ());
66
+ $ this ->assertEquals ( $ result , $ this ->model ->isEnabled ());
66
67
}
67
68
68
69
/**
69
- * Test isNotEnabled ()
70
+ * Data provider for isEnabled ()
70
71
*
71
- * @return void
72
+ * @return array
72
73
*/
73
- public function testIsNotEnabled (): void
74
+ public function isEnabledDataProvider (): array
74
75
{
75
- $ this ->scopeConfigMock ->expects ($ this ->once ())
76
- ->method ('isSetFlag ' )
77
- ->with (config::XML_PATH_ENABLED , ScopeInterface::SCOPE_STORE )
78
- ->willReturn (false );
79
-
80
- $ this ->assertFalse ($ this ->model ->isEnabled ());
76
+ return [
77
+ [true , true ],
78
+ [false , false ]
79
+ ];
81
80
}
82
81
83
82
/**
You can’t perform that action at this time.
0 commit comments