Skip to content

Commit

Permalink
Increase coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
cweagans committed Feb 2, 2023
1 parent 5659de5 commit 894ea91
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Patch.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class Patch implements JsonSerializable
* A json_encode'd representation of a Patch.
*
* @return Patch
* A Patch with all of the serialized properties set.
* A Patch with all serialized properties set.
*/
public static function fromJson($json): static
{
Expand Down
22 changes: 19 additions & 3 deletions tests/unit/RootComposerResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,32 @@ public function testResolve()
$resolver->resolve($patch_collection, $event);
$this->assertCount(0, $patch_collection->getPatchesForPackage('test/package'));

// One patch.
// One patch (expanded definition)
$root_package->setExtra([
'patches' => [
'test/package' => [
0 => [
'url' => 'https://drupal.org',
'description' => 'Test patch'
],
]
]
],
],
]);

$composer->setPackage($root_package);
$resolver = new RootComposer($composer, $io);
$resolver->resolve($patch_collection, $event);
$this->assertCount(1, $patch_collection->getPatchesForPackage('test/package'));


// One patch (compact definition)
$patch_collection = new PatchCollection();
$root_package->setExtra([
'patches' => [
'test/package' => [
'Test patch' => 'https://drupal.org',
],
],
]);

$composer->setPackage($root_package);
Expand Down

0 comments on commit 894ea91

Please sign in to comment.