@@ -55,3 +55,34 @@ Feature: Manage maintenance mode of WordPress install.
5555 """
5656 Error: Maintenance mode already deactivated.
5757 """
58+
59+ When I run `wp maintenance-mode activate`
60+ Then STDOUT should be:
61+ """
62+ Enabling Maintenance mode...
63+ Success: Activated Maintenance mode.
64+ """
65+
66+ Scenario : Check maintenance mode status when expression is used.
67+
68+ When I run `wp eval "file_put_contents('.maintenance', '<?php \$ upgrading=(time()-601);'); " `
69+ And I try `wp maintenance-mode is-active`
70+ Then the return code should be 1
71+ And STDERR should contain:
72+ """
73+ Warning: Unable to read the maintenance file timestamp, non-numeric value detected.
74+ """
75+
76+ Scenario : Check maintenance mode status when numeric timestamp is used.
77+
78+ When I run `wp eval "file_put_contents('.maintenance', '<?php \$ upgrading=' . ( time() + 100 ) . ';'); " `
79+ And I run `wp maintenance-mode is-active`
80+ Then the return code should be 0
81+
82+ When I run `wp eval "file_put_contents('.maintenance', '<?php \$ upgrading =' . ( time() + 100 ) . ';') ; " `
83+ And I run `wp maintenance-mode is-active`
84+ Then the return code should be 0
85+
86+ When I run `wp eval "file_put_contents('.maintenance', '<?php \$ upgrading= ' . ( time() + 100 ) . ';'); " `
87+ And I run `wp maintenance-mode is-active`
88+ Then the return code should be 0
0 commit comments