-
-
Notifications
You must be signed in to change notification settings - Fork 238
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #211 from cweagans/patch-value-object
Add a patch value object + support a more verbose patch format
- Loading branch information
Showing
4 changed files
with
121 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
namespace cweagans\Composer; | ||
|
||
class Patch | ||
{ | ||
/** | ||
* The package that the patch belongs to. | ||
* | ||
* @var string $package | ||
*/ | ||
public $package; | ||
|
||
/** | ||
* The description of what the patch does. | ||
* | ||
* @var string $description | ||
*/ | ||
public $description; | ||
|
||
/** | ||
* The URL where the patch is stored. Can be local. | ||
* | ||
* @var string $url | ||
*/ | ||
public $url; | ||
|
||
/** | ||
* The sha1 hash of the patch file. | ||
* | ||
* @var string $sha1 | ||
*/ | ||
public $sha1; | ||
|
||
/** | ||
* The patch depth to use when applying the patch (-p flag for `patch`) | ||
* | ||
* @var int $depth | ||
*/ | ||
public $depth; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?php | ||
$I = new AcceptanceTester($scenario); | ||
$I->wantTo('apply a patch to a package using the expanded definition format (required props only'); | ||
$I->amInPath(realpath(__DIR__ . '/fixtures/expanded-definition-required-only')); | ||
$I->runShellCommand('composer install'); | ||
$I->canSeeFileFound('./vendor/drupal/drupal/.ht.router.php'); |
26 changes: 26 additions & 0 deletions
26
tests/acceptance/fixtures/expanded-definition-required-only/composer.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"name": "cweagans/composer-patches-test-project", | ||
"description": "Project for use in cweagans/composer-patches acceptance tests.", | ||
"type": "project", | ||
"license": "BSD-2-Clause", | ||
"repositories": [ | ||
{ | ||
"type": "path", | ||
"url": "../composer-patches" | ||
} | ||
], | ||
"require": { | ||
"cweagans/composer-patches": "*@dev", | ||
"drupal/drupal": "~8.2" | ||
}, | ||
"extra": { | ||
"patches": { | ||
"drupal/drupal": [ | ||
{ | ||
"description": "Add a startup config for the PHP web server", | ||
"url": "https://www.drupal.org/files/issues/add_a_startup-1543858-58.patch" | ||
} | ||
] | ||
} | ||
} | ||
} |