Skip to content

Commit 9c3d58d

Browse files
committed
MAGECLOUD-1057: Add possibility to change SCD strategy
1 parent 9cebb0f commit 9c3d58d

File tree

3 files changed

+7
-80
lines changed

3 files changed

+7
-80
lines changed

src/Magento/MagentoCloud/Test/Unit/Config/BuildTest.php

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,4 @@ public function testGetVerbosityLevel()
6565
$this->build->getVerbosityLevel()
6666
);
6767
}
68-
69-
public function testGetScdStrategy()
70-
{
71-
$this->readerMock->expects($this->once())
72-
->method('read')
73-
->willReturn([
74-
Build::OPT_SCD_STRATEGY => 'quick',
75-
]);
76-
77-
$this->assertSame(
78-
'-s quick',
79-
$this->build->getScdStrategy()
80-
);
81-
}
8268
}

src/Magento/MagentoCloud/Test/Unit/Process/Deploy/DeployStaticContent/GenerateTest.php

Lines changed: 6 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -101,78 +101,19 @@ public function testExecute()
101101
['Generating static content for locales: en_GB fr_FR'],
102102
['Maintenance mode is disabled.']
103103
);
104-
$this->environmentMock->expects($this->exactly(2))
105-
->method('getAdminLocale')
106-
->willReturn('fr_FR');
107-
$this->shellMock->method('execute')
104+
$this->commandMock->expects($this->once())
105+
->method('create')
106+
->willReturn('php ./bin/magento static:content:deploy:command');
107+
$this->shellMock->expects($this->exactly(3))
108+
->method('execute')
108109
->withConsecutive(
109110
['php ./bin/magento maintenance:enable -vvv '],
110-
['php ./bin/magento setup:static-content:deploy -f en_GB fr_FR -vvv -s compact'],
111+
['php ./bin/magento static:content:deploy:command'],
111112
['php ./bin/magento maintenance:disable -vvv ']
112113
);
113114
$this->environmentMock->method('getVerbosityLevel')
114115
->willReturn(' -vvv ');
115116

116117
$this->process->execute();
117118
}
118-
119-
public function testExecuteEmptyLocales()
120-
{
121-
$this->directoryListMock->method('getMagentoRoot')
122-
->willReturn('magento_root');
123-
$this->fileMock->expects($this->once())
124-
->method('touch')
125-
->with('magento_root/pub/static/deployed_version.txt');
126-
$this->loggerMock->method('notice')
127-
->withConsecutive(
128-
['Enabling Maintenance mode'],
129-
['Extracting locales'],
130-
['Generating static content for locales: fr_FR'],
131-
['Maintenance mode is disabled.']
132-
);
133-
$this->environmentMock->expects($this->exactly(2))
134-
->method('getAdminLocale')
135-
->willReturn('fr_FR');
136-
$this->shellMock->method('execute')
137-
->withConsecutive(
138-
['php ./bin/magento maintenance:enable -vvv '],
139-
['php ./bin/magento setup:static-content:deploy -f fr_FR -vvv -s compact'],
140-
['php ./bin/magento maintenance:disable -vvv ']
141-
);
142-
$this->environmentMock->method('getVerbosityLevel')
143-
->willReturn(' -vvv ');
144-
145-
$this->process->execute();
146-
}
147-
148-
public function testExecuteExcludedThemes()
149-
{
150-
$this->directoryListMock->method('getMagentoRoot')
151-
->willReturn('magento_root');
152-
$this->fileMock->expects($this->once())
153-
->method('touch')
154-
->with('magento_root/pub/static/deployed_version.txt');
155-
$this->loggerMock->method('info')
156-
->withConsecutive(
157-
['Enabling Maintenance mode'],
158-
['Extracting locales'],
159-
['Generating static content for locales: en_GB fr_FR'],
160-
['Maintenance mode is disabled.']
161-
);
162-
$this->environmentMock->expects($this->exactly(2))
163-
->method('getAdminLocale')
164-
->willReturn('fr_FR');
165-
$this->shellMock->method('execute')
166-
->withConsecutive(
167-
['php ./bin/magento maintenance:enable -vvv '],
168-
['php ./bin/magento setup:static-content:deploy -f --exclude-theme=en_GB en_GB fr_FR -vvv '],
169-
['php ./bin/magento maintenance:disable -vvv ']
170-
);
171-
$this->environmentMock->method('getVerbosityLevel')
172-
->willReturn(' -vvv ');
173-
$this->environmentMock->method('getStaticDeployExcludeThemes')
174-
->willReturn('en_GB');
175-
176-
$this->process->execute();
177-
}
178119
}

src/Magento/MagentoCloud/Test/Unit/StaticContent/Deploy/OptionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ public function testGetLocalesWithExistsAdminLocale()
149149
['value' => 'fr_FR'],
150150
['value' => 'de_DE'],
151151
]);
152-
$this->environmentMock->expects($this->exactly(2))
152+
$this->environmentMock->expects($this->exactly(1))
153153
->method('getAdminLocale')
154154
->willReturn('fr_FR');
155155

0 commit comments

Comments
 (0)