Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,16 @@ jobs:
uses: tj-actions/changed-files@v46
with:
files: |
config
lang
resources/users
resources/views
routes
src
tests
config/**
lang/**
resources/users/**
resources/views/**
routes/**
src/**
tests/**
composer.json
phpunit.xml.dist
.github/workflows/tests.yml
tests/Composer/__fixtures__
**.php

- name: Determine whether tests should run
Expand Down
4 changes: 2 additions & 2 deletions src/Console/Processes/Composer.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function installed()
return collect();
}

return collect($this->runJsonComposerCommand('show', '--direct', '--no-plugins')->installed)
return collect($this->runJsonComposerCommand('show', '--direct', '--no-plugins')?->installed ?? [])
->keyBy('name')
->map(function ($package) use ($lock) {
$package->version = $this->normalizeVersion($package->version);
Expand Down Expand Up @@ -99,7 +99,7 @@ public function installedVersion(string $package)
*/
public function installedPath(string $package)
{
return collect($this->runJsonComposerCommand('show', '--direct', '--path', '--no-plugins')->installed)
return collect($this->runJsonComposerCommand('show', '--direct', '--path', '--no-plugins')?->installed ?? [])
->keyBy('name')
->get($package)
->path;
Expand Down
8 changes: 0 additions & 8 deletions tests/Composer/ComposerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,6 @@ public function it_can_get_installed_path_of_a_package()
__DIR__.'/__fixtures__/vendor/statamic/composer-test-example-dependency',
Composer::installedPath('statamic/composer-test-example-dependency')
);

$this->assertEquals(
__DIR__.'/__fixtures__/vendor/composer/composer',
Composer::installedPath('composer/composer')
);
}

#[Group('integration')]
Expand Down Expand Up @@ -224,9 +219,6 @@ public function it_can_require_and_remove_multiple_packages_in_one_shot()
PackToTheFuture::generateComposerJson('test/two', '2.0.0', [], $this->basePath('tmp/two/composer.json'));

$repositories = [
'require' => [
'composer/composer' => '^2.0.0',
],
'repositories' => [
['type' => 'path', 'url' => $this->basePath('tmp/one'), 'options' => ['symlink' => false]],
['type' => 'path', 'url' => $this->basePath('tmp/two'), 'options' => ['symlink' => false]],
Expand Down
1 change: 0 additions & 1 deletion tests/Composer/__fixtures__/composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "statamic/composer-test",
"require": {
"composer/composer": "^2.2.12",
"statamic/composer-test-example-dependency": "1.2.3"
},
"require-dev": {
Expand Down
Loading
Loading