Skip to content

Commit 559ca8d

Browse files
authored
Merge pull request #185 from firegento/develop
Merge develop into master
2 parents 09d855f + 1c6b38a commit 559ca8d

File tree

15 files changed

+223
-130
lines changed

15 files changed

+223
-130
lines changed

.travis.yml

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,34 @@
1-
sudo: required
2-
dist: trusty
3-
addons:
4-
apt:
5-
packages:
6-
- mysql-server-5.6
7-
- mysql-client-core-5.6
8-
- mysql-client-5.6
1+
dist: bionic
2+
services:
3+
- mysql
4+
- elasticsearch
95
env:
106
global:
117
- COVERAGE: false
128

13-
matrix:
9+
jobs:
1410
fast_finish: true
1511
include:
16-
# make sure it is running on the oldest supported version
17-
- php: 7.2
18-
env: MAGENTO_VERSION=2.3.0
19-
# fix the code quality check to a specific, but rather new version
12+
# fix the code quality check to a specific version
2013
- php: 7.2
2114
env: MAGENTO_VERSION=2.3.5-p1 CODE_QUALITY=true
22-
# make sure it is running on the latest version
15+
# make sure it is running on the oldest and latest version for each release line
2316
- php: 7.2
24-
env: MAGENTO_VERSION=2.3.1 INTEGRATION_TEST=true
17+
env: MAGENTO_VERSION=2.3.0
2518
- php: 7.2
26-
env: MAGENTO_VERSION=2.3.* INTEGRATION_TEST=true
19+
env: MAGENTO_VERSION=2.3.*
20+
- php: 7.3
21+
env: MAGENTO_VERSION=2.3.3
22+
- php: 7.3
23+
env: MAGENTO_VERSION=2.3.*
2724
- php: 7.3
28-
env: MAGENTO_VERSION=2.3.3 INTEGRATION_TEST=true
25+
env: MAGENTO_VERSION=2.4.0 UNIT_TEST=true INTEGRATION_TEST=true
2926
- php: 7.3
30-
env: MAGENTO_VERSION=2.3.* INTEGRATION_TEST=true
27+
env: MAGENTO_VERSION=2.4.* UNIT_TEST=true INTEGRATION_TEST=true
28+
- php: 7.4
29+
env: MAGENTO_VERSION=2.4.0 UNIT_TEST=true INTEGRATION_TEST=true
30+
- php: 7.4
31+
env: MAGENTO_VERSION=2.4.* UNIT_TEST=true INTEGRATION_TEST=true
3132

3233

3334
language: php
@@ -43,7 +44,7 @@ before_install:
4344
- "./Test/script/travis_before_install.sh"
4445

4546
install:
46-
- echo "{\"http-basic\":{\"repo.magento.com\":{\"username\":\"${MAGENTO_USERNAME}\",\"password\":\"${MAGENTO_PASSWORD}\"}}}" > $HOME/.composer/auth.json
47+
- composer config -g http-basic.repo.magento.com "$MAGENTO_USERNAME" "$MAGENTO_PASSWORD"
4748
- export MAGENTO_ROOT=`mktemp -d /tmp/mage.XXXXXXXX`
4849
- "./Test/script/travis_install_magento.sh $MAGENTO_VERSION"
4950

CHANGELOG.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,24 @@
11
# Changelog
22
All notable changes to this project will be documented in this file.
33

4-
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
4+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
55

6-
## v0.3.0
6+
## [Unreleased]
7+
### Fixed
8+
- ...
9+
10+
### Added
11+
- ...
12+
13+
### Removed
14+
- ...
15+
16+
## [v0.4.0] - 2020-10-08
17+
### Added
18+
- Support for Magento 2.4 (thanks @sprankhub)
19+
- Support for PHP 7.4 (thanks @sprankhub)
20+
21+
## [v0.3.0] - 2020-06-30
722
### Fixed
823
- Fix imprint blocks in mails [#149](https://github.com/firegento/firegento-magesetup2/issues/149) (thanks @sprankhub)
924
- Hide tax details for grouped product [#150](https://github.com/firegento/firegento-magesetup2/issues/150) (thanks @sprankhub)
@@ -21,7 +36,6 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
2136
- Add integration test to travis ci [#166](https://github.com/firegento/firegento-magesetup2/issues/166) (thanks @frostblogNet)
2237
- Add unit test form blocks (thanks @frostblogNet)
2338
- Add integration test for visible in checkout property (thanks @sprankhub)
24-
2539

2640
### Removed
2741
- Remove price details from tier prices [#87](https://github.com/firegento/firegento-magesetup2/issues/87) (thanks @sprankhub)

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ Missing your country? Please open a pull request with the necessary configuratio
2727

2828
Requirements
2929
------------
30-
- PHP >= 7.2
31-
- Magento >= 2.3.*
30+
- PHP >= 7.2
31+
- Magento 2.3.* / 2.4.*
3232

3333
Installation
3434
------------

Test/Integration/ModuleConfigTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,20 @@ protected function setUp(): void
3131
public function testTheModuleIsRegistered(): void
3232
{
3333
$registrar = new ComponentRegistrar();
34-
$this->assertArrayHasKey($this->subjectModuleName, $registrar->getPaths(ComponentRegistrar::MODULE));
34+
self::assertArrayHasKey($this->subjectModuleName, $registrar->getPaths(ComponentRegistrar::MODULE));
3535
}
3636

3737
public function testModuleIsListed(): void
3838
{
3939
/** @var ModuleList $moduleList */
4040
$moduleList = $this->objectManager->create(ModuleList::class);
41-
$this->assertTrue($moduleList->has($this->subjectModuleName));
41+
self::assertTrue($moduleList->has($this->subjectModuleName));
4242
}
4343

4444
public function testTheModuleIsConfiguredInTheTestEnvironment(): void
4545
{
4646
/** @var ModuleList $moduleList */
4747
$moduleList = $this->objectManager->create(ModuleList::class);
48-
$this->assertTrue($moduleList->has($this->subjectModuleName));
48+
self::assertTrue($moduleList->has($this->subjectModuleName));
4949
}
5050
}

Test/Integration/Observer/AddProductAttributeVisibleCheckoutObserverTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ public function testExecute()
2020
$attribute = $productAttributeRepository->get('name');
2121
$this->getRequest()->setParam('attribute_id', $attribute->getAttributeId());
2222
$this->dispatch($this->uri);
23-
$this->assertContains('Visible in Checkout', $this->getResponse()->getBody());
23+
self::assertStringContainsString('Visible in Checkout', $this->getResponse()->getBody());
2424
}
2525
}

Test/Unit/Block/Imprint/ContentTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ class ContentTest extends TestCase
2929
/** @var ScopeConfigInterface|MockObject */
3030
protected $scopeConfigMock;
3131

32-
public function setUp()
32+
public function setUp(): void
3333
{
34-
parent::setUp(); // TODO: Change the autogenerated stub
34+
parent::setUp();
3535

3636
$this->countryInformationAcquirerMock = $this
3737
->getMockBuilder(CountryInformationAcquirerInterface::class)
@@ -86,7 +86,7 @@ public function testGetCountry(): void
8686
->method('getCountryInfo')
8787
->willReturn($countryInformationAcquirerInterfaceMock);
8888

89-
$this->assertSame($countryName, $this->sut->getCountry());
89+
self::assertSame($countryName, $this->sut->getCountry());
9090
}
9191

9292
public function testGetWeb(): void
@@ -97,20 +97,20 @@ public function testGetWeb(): void
9797
->method('getValue')
9898
->willReturn($baseUrl);
9999

100-
$this->assertSame($baseUrl, $this->sut->getWeb());
100+
self::assertSame($baseUrl, $this->sut->getWeb());
101101
}
102102

103103
public function testGetEmail(): void
104104
{
105105
$email = "[email protected]";
106106
# empty email case 1
107-
$this->assertSame('', $this->sut->getEmail());
107+
self::assertSame('', $this->sut->getEmail());
108108
# antispam true
109109
$this->scopeConfigMock
110-
->expects($this->at(0))
110+
->expects(self::at(0))
111111
->method('getValue')
112112
->willReturn($email);
113-
$this->assertSame($email, $this->sut->getEmail(false));
113+
self::assertSame($email, $this->sut->getEmail(false));
114114
$this->scopeConfigMock
115115
->expects($this->at(0))
116116
->method('getValue')
@@ -119,6 +119,6 @@ public function testGetEmail(): void
119119
$expected = '<a href="#" onclick="toRecipient();">max<span class="no-display">nospamplease'
120120
. '</span>@<span class="no-display">nospamplease</span>muster.de</a><script>function '
121121
. 'toRecipient(){var m = \'max\';m += \'@\';m += \'muster.de\';location.href= "mailto:"+m;}</script>';
122-
$this->assertSame($expected, $this->sut->getEmail(true));
122+
self::assertSame($expected, $this->sut->getEmail(true));
123123
}
124124
}

Test/Unit/Block/Price/DetailsTest.php

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class DetailsTest extends TestCase
5050
/** @var \Magento\Store\Model\StoreManagement|MockObject */
5151
protected $storeManagerMock;
5252

53-
public function setUp()
53+
public function setUp(): void
5454
{
5555
parent::setUp();
5656

@@ -62,7 +62,7 @@ public function setUp()
6262
$this->contextMock = $this->createMock(Context::class);
6363

6464
$this->contextMock
65-
->expects($this->atLeastOnce())
65+
->expects(self::atLeastOnce())
6666
->method('getStoreManager')
6767
->willReturn($this->storeManagerMock);
6868

@@ -95,14 +95,14 @@ public function testSetSaleableItem(): void
9595
->disableOriginalConstructor()
9696
->getMockForAbstractClass();
9797
$this->sut->setSaleableItem($saleableItemMock);
98-
$this->assertNull($this->sut->getData('tax_rate'));
98+
self::assertNull($this->sut->getData('tax_rate'));
9999
}
100100

101101
public function testGetFormattedTaxRate(): void
102102
{
103103
$this->sut->setData('tax_rate', '19');
104104
$expected = new Phrase('%1%', ['19']);
105-
$this->assertEquals($expected, $this->sut->getFormattedTaxRate());
105+
self::assertEquals($expected, $this->sut->getFormattedTaxRate());
106106
}
107107

108108
public function testGetFormattedTaxRateIsZero(): void
@@ -112,13 +112,13 @@ public function testGetFormattedTaxRateIsZero(): void
112112
->disableOriginalConstructor()
113113
->getMockForAbstractClass();
114114
$saleableItemMock
115-
->expects($this->at(0))
115+
->expects(self::at(0))
116116
->method('getTaxPercent')
117117
->willReturn(7);
118118

119119
$this->sut->setSaleableItem($saleableItemMock);
120120
$expected = new Phrase('%1%', ['7']);
121-
$this->assertEquals($expected, $this->sut->getFormattedTaxRate());
121+
self::assertEquals($expected, $this->sut->getFormattedTaxRate());
122122
}
123123

124124
public function testGetFormattedTaxRateIsFive(): void
@@ -128,12 +128,12 @@ public function testGetFormattedTaxRateIsFive(): void
128128
->disableOriginalConstructor()
129129
->getMockForAbstractClass();
130130
$saleableItem2Mock
131-
->expects($this->at(0))
131+
->expects(self::at(0))
132132
->method('getTaxPercent')
133133
->willReturn(null);
134134

135135
$saleableItem2Mock
136-
->expects($this->at(1))
136+
->expects(self::at(1))
137137
->method('getTaxClassId')
138138
->willReturn('simple');
139139

@@ -142,81 +142,81 @@ public function testGetFormattedTaxRateIsFive(): void
142142
->getMockForAbstractClass();
143143

144144
$this->storeManagerMock
145-
->expects($this->at(0))
145+
->expects(self::at(0))
146146
->method('getStore')
147147
->willReturn($storeMock);
148148

149149
$this->customerSessionMock
150-
->expects($this->at(0))
150+
->expects(self::at(0))
151151
->method('getCustomerGroupId')
152152
->willReturn(10);
153153
$groupMock = $this->createMock(\Magento\Customer\Model\Data\Group::class);
154154

155155
$groupMock
156-
->expects($this->at(0))
156+
->expects(self::at(0))
157157
->method('getTaxClassId')
158158
->willReturn(20);
159159

160160
$this->groupRepositoryMock
161-
->expects($this->at(0))
161+
->expects(self::at(0))
162162
->method('getById')
163163
->withAnyParameters(10)
164164
->willReturn($groupMock);
165165

166166
$dataMock = $this->createMock(\Magento\Framework\DataObject::class);
167167

168168
$dataMock
169-
->expects($this->at(0))
169+
->expects(self::at(0))
170170
->method('setData')
171171
->willReturn($dataMock);
172172

173173
$this->taxCalculationMock
174-
->expects($this->at(0))
174+
->expects(self::at(0))
175175
->method('getRateRequest')
176176
->willReturn($dataMock);
177177

178178
$this->taxCalculationMock
179-
->expects($this->at(1))
179+
->expects(self::at(1))
180180
->method('getRate')
181181
->willReturn(5);
182182

183183
$this->sut->setSaleableItem($saleableItem2Mock);
184184
$expected = new Phrase('%1%', ['5']);
185-
$this->assertEquals($expected, $this->sut->getFormattedTaxRate());
185+
self::assertEquals($expected, $this->sut->getFormattedTaxRate());
186186
}
187187

188188
public function testGetPriceDisplayType(): void
189189
{
190190
$this->taxHelperMock
191-
->expects($this->at(0))
191+
->expects(self::at(0))
192192
->method('getPriceDisplayType')
193193
->willReturn(4);
194-
$this->assertSame(4, $this->sut->getPriceDisplayType());
194+
self::assertSame(4, $this->sut->getPriceDisplayType());
195195
}
196196

197197
public function testIsIncludingShippingCosts(): void
198198
{
199-
$this->assertFalse($this->sut->isIncludingShippingCosts());
199+
self::assertFalse($this->sut->isIncludingShippingCosts());
200200

201201
$this->sut->setData('is_including_shipping_costs', null);
202-
$this->assertFalse($this->sut->isIncludingShippingCosts());
202+
self::assertFalse($this->sut->isIncludingShippingCosts());
203203

204204
$this->sut->setData('is_including_shipping_costs', 1);
205-
$this->assertTrue($this->sut->isIncludingShippingCosts());
205+
self::assertTrue($this->sut->isIncludingShippingCosts());
206206

207207
$this->sut->unsetData('is_including_shipping_costs');
208208
$this->magesetupConfigMock
209-
->expects($this->at(0))
209+
->expects(self::at(0))
210210
->method('isIncludingShippingCosts')
211211
->willReturn(false);
212-
$this->assertFalse($this->sut->isIncludingShippingCosts());
212+
self::assertFalse($this->sut->isIncludingShippingCosts());
213213

214214
$this->sut->unsetData('is_including_shipping_costs');
215215
$this->magesetupConfigMock
216-
->expects($this->at(0))
216+
->expects(self::at(0))
217217
->method('isIncludingShippingCosts')
218218
->willReturn(true);
219-
$this->assertTrue($this->sut->isIncludingShippingCosts());
219+
self::assertTrue($this->sut->isIncludingShippingCosts());
220220
}
221221

222222
public function testCanShowShippingLink(): void
@@ -226,29 +226,29 @@ public function testCanShowShippingLink(): void
226226
->disableOriginalConstructor()
227227
->getMockForAbstractClass();
228228
$saleableItemMock
229-
->expects($this->at(0))
229+
->expects(self::at(0))
230230
->method('getTypeId')
231231
->willReturn('virtual');
232232

233233
$this->sut->setSaleableItem($saleableItemMock);
234-
$this->assertFalse($this->sut->canShowShippingLink());
234+
self::assertFalse($this->sut->canShowShippingLink());
235235

236236
$saleableItemMock
237-
->expects($this->at(0))
237+
->expects(self::at(0))
238238
->method('getTypeId')
239239
->willReturn('configurable');
240240

241241
$this->sut->setSaleableItem($saleableItemMock);
242-
$this->assertTrue($this->sut->canShowShippingLink());
242+
self::assertTrue($this->sut->canShowShippingLink());
243243
}
244244

245245
public function testGetShippingCostUrl()
246246
{
247247
$shippingCostUrl = "http://shop.firegento.com/shipping";
248248
$this->magesetupConfigMock
249-
->expects($this->at(0))
249+
->expects(self::at(0))
250250
->method('getShippingCostUrl')
251251
->willReturn($shippingCostUrl);
252-
$this->assertSame($shippingCostUrl, $this->sut->getShippingCostUrl());
252+
self::assertSame($shippingCostUrl, $this->sut->getShippingCostUrl());
253253
}
254254
}

0 commit comments

Comments
 (0)