Skip to content

Commit 9b51230

Browse files
committed
Added removal of tests in consumer's autoload-dev.
1 parent 3fbf2b2 commit 9b51230

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

CustomizeCommand.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ protected function cleanup(): void {
225225
static::arrayUnsetDeep($json, ['scripts', 'post-create-project-cmd'], '@customize');
226226

227227
static::arrayUnsetDeep($json, ['require-dev', 'alexskrypnyk/customizer']);
228+
static::arrayUnsetDeep($json, ['autoload-dev', 'psr-4', 'AlexSkrypnyk\\Customizer\\Tests\\']);
228229

229230
// If the package data has changed, update the composer.json file.
230231
if (strcmp(serialize($this->packageData), serialize($json)) !== 0) {

tests/phpunit/Fixtures/plugin/composer.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@
99
"require-dev": {
1010
"alexskrypnyk/customizer": "@dev"
1111
},
12+
"autoload-dev": {
13+
"psr-4": {
14+
"AlexSkrypnyk\\Customizer\\Tests\\": "vendor/alexskrypnyk/customizer/tests/phpunit",
15+
"AlexSkrypnyk\\TemplateProjectExample\\Tests\\": "tests"
16+
}
17+
},
1218
"minimum-stability": "dev",
1319
"config": {
1420
"allow-plugins": {

tests/phpunit/Functional/CreateProjectPluginTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ public function testPluginInstall(): void {
4949
$this->assertEquals('MIT', $json['license']);
5050

5151
$this->assertArrayNotHasKey('require-dev', $json);
52+
$this->assertArrayNotHasKey('AlexSkrypnyk\\Customizer\\Tests\\', $json['autoload-dev']['psr-4']);
5253
$this->assertArrayNotHasKey('allow-plugins', $json['config']);
5354
$this->assertFileDoesNotExist($this->customizerFile);
5455

@@ -69,6 +70,7 @@ public function testPluginInstallNoConfigFile(): void {
6970
$this->assertFileExists('composer.json');
7071
$this->assertFileExists('composer.lock');
7172
$this->assertDirectoryExists('vendor');
73+
7274
// Plugin will only clean up after itself if there were questions.
7375
$this->assertDirectoryExists('vendor/alexskrypnyk/customizer');
7476

@@ -78,6 +80,7 @@ public function testPluginInstallNoConfigFile(): void {
7880
$this->assertEquals('proprietary', $json['license']);
7981

8082
$this->assertArrayHasKey('alexskrypnyk/customizer', $json['require-dev']);
83+
$this->assertArrayHasKey('AlexSkrypnyk\\Customizer\\Tests\\', $json['autoload-dev']['psr-4']);
8184
$this->assertArrayHasKey('alexskrypnyk/customizer', $json['config']['allow-plugins']);
8285
$this->assertFileDoesNotExist($this->customizerFile);
8386

0 commit comments

Comments
 (0)