@@ -94,6 +94,14 @@ public function tearDown()
94
94
$ this ->writer ->saveConfig ([ConfigFilePool::APP_ENV => $ this ->envConfig ]);
95
95
96
96
$ this ->clearStaticFiles ();
97
+ // enable default mode
98
+ $ this ->commandTester = new CommandTester ($ this ->getStaticContentDeployCommand ());
99
+ $ this ->commandTester ->execute (
100
+ ['mode ' => 'default ' ]
101
+ );
102
+ $ commandOutput = $ this ->commandTester ->getDisplay ();
103
+ $ this ->assertEquals (Cli::RETURN_SUCCESS , $ this ->commandTester ->getStatusCode ());
104
+ $ this ->assertContains ('Enabled default mode ' , $ commandOutput );
97
105
}
98
106
99
107
/**
@@ -111,23 +119,11 @@ public function testSwitchMode()
111
119
{
112
120
if ($ this ->prevMode === 'production ' ) {
113
121
//in production mode, so we have to switch to dev, then to production
114
- $ this ->clearStaticFiles ();
115
122
$ this ->enableAndAssertDeveloperMode ();
116
123
$ this ->enableAndAssertProductionMode ();
117
124
} else {
118
125
//already in non production mode
119
- //$this->clearStaticFiles();
120
126
$ this ->enableAndAssertProductionMode ();
121
-
122
- // enable previous mode
123
- $ this ->clearStaticFiles ();
124
- $ this ->commandTester = new CommandTester ($ this ->getStaticContentDeployCommand ());
125
- $ this ->commandTester ->execute (
126
- ['mode ' => $ this ->prevMode ]
127
- );
128
- $ commandOutput = $ this ->commandTester ->getDisplay ();
129
- $ this ->assertEquals (Cli::RETURN_SUCCESS , $ this ->commandTester ->getStatusCode ());
130
- $ this ->assertContains ('Enabled ' . $ this ->prevMode . ' mode ' , $ commandOutput );
131
127
}
132
128
}
133
129
@@ -139,7 +135,6 @@ public function testSwitchMode()
139
135
private function enableAndAssertProductionMode ()
140
136
{
141
137
// Enable production mode
142
- $ this ->clearStaticFiles ();
143
138
$ this ->commandTester = new CommandTester ($ this ->getStaticContentDeployCommand ());
144
139
$ this ->commandTester ->execute (
145
140
['mode ' => 'production ' ]
0 commit comments