Skip to content

Commit c0a5d22

Browse files
committed
OXDEV-10008 Fix composer dependency
1 parent 3255860 commit c0a5d22

File tree

4 files changed

+22
-20
lines changed

4 files changed

+22
-20
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
### Added
66
- PHP v8.5 support
77

8+
### Fixed
9+
- Moved `composer/composer` to `require-dev` [#0007877](https://bugs.oxid-esales.com/view.php?id=7877)
10+
811
### Removed
912
- PHP v8.2 support
1013

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
"require": {
77
"php": "^8.3",
88
"composer-plugin-api": ">=2.0",
9-
"composer/composer": ">=2.0",
109
"oxid-esales/oxideshop-facts": "*",
1110
"symfony/filesystem": "^6.3",
1211
"twig/twig": "^3.14"
1312
},
1413
"require-dev": {
14+
"composer/composer": ">=2.0",
1515
"mikey179/vfsstream": "^1.6",
1616
"symfony/yaml": "*"
1717
},

tests/Integration/FactsMockTrait.php

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,25 @@
1010
namespace OxidEsales\UnifiedNameSpaceGenerator\Tests\Integration;
1111

1212
use OxidEsales\Facts\Facts;
13-
use PHPUnit\Framework\MockObject\MockObject;
1413

1514
trait FactsMockTrait
1615
{
17-
private function getFactsMock(string $edition = 'CE'): Facts|MockObject
16+
private function getFactsMock(string $edition = 'CE'): Facts
1817
{
19-
$mock = $this->getMockBuilder(Facts::class)
20-
->disableOriginalConstructor()
21-
->onlyMethods(['getEdition', 'getShopRootPath'])
22-
->getMock();
23-
$mock->expects($this->any())
24-
->method('getEdition')
18+
$root = $this->getVirtualFilesystemRootPath();
19+
20+
$stub = $this->createStub(Facts::class);
21+
$stub->method('getEdition')
2522
->willReturn($edition);
26-
$mock->expects($this->any())
27-
->method('getShopRootPath')
28-
->willReturn($this->getVirtualFilesystemRootPath());
23+
$stub->method('getShopRootPath')
24+
->willReturn($root);
25+
$stub->method('getCommunityEditionSourcePath')
26+
->willReturn($root . 'vendor/oxid-esales/oxideshop-ce/source');
27+
$stub->method('getProfessionalEditionRootPath')
28+
->willReturn($root . 'vendor/oxid-esales/oxideshop-pe');
29+
$stub->method('getEnterpriseEditionRootPath')
30+
->willReturn($root . 'vendor/oxid-esales/oxideshop-ee');
2931

30-
return $mock;
32+
return $stub;
3133
}
3234
}

tests/Integration/GeneratorTest.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
namespace OxidEsales\UnifiedNameSpaceGenerator\Tests\Integration;
1111

1212
use FilesystemIterator;
13+
use OxidEsales\Facts\Facts;
1314
use OxidEsales\UnifiedNameSpaceGenerator\Exceptions\FileSystemCompatibilityException;
1415
use OxidEsales\UnifiedNameSpaceGenerator\Exceptions\OutputDirectoryValidationException;
1516
use OxidEsales\UnifiedNameSpaceGenerator\Generator;
1617
use OxidEsales\UnifiedNameSpaceGenerator\UnifiedNameSpaceClassMapProvider;
1718
use PHPUnit\Framework\Attributes\DataProvider;
18-
use PHPUnit\Framework\MockObject\MockObject;
1919
use PHPUnit\Framework\TestCase;
2020
use Symfony\Component\Filesystem\Path;
2121

@@ -344,17 +344,14 @@ private function getOutputDirectory(): string
344344
return Path::join(__DIR__, 'test_generated');
345345
}
346346

347-
protected function getUnifiedNameSpaceProviderMock(Facts|MockObject $facts, $classMap = null): UnifiedNameSpaceClassMapProvider
347+
protected function getUnifiedNameSpaceProviderMock(Facts $facts, $classMap = null): UnifiedNameSpaceClassMapProvider
348348
{
349349
if (empty($classMap) && [] !== $classMap) {
350350
$classMap = $this->classMapExample;
351351
}
352352

353-
$mock = $this->getMockBuilder(UnifiedNameSpaceClassMapProvider::class)
354-
->disableOriginalConstructor()
355-
->onlyMethods(['getClassMap'])
356-
->getMock();
357-
$mock->expects($this->any())->method('getClassMap')->willReturn($classMap);
353+
$mock = $this->createStub(UnifiedNameSpaceClassMapProvider::class);
354+
$mock->method('getClassMap')->willReturn($classMap);
358355

359356
return $mock;
360357
}

0 commit comments

Comments
 (0)