Skip to content

Instantly share code, notes, and snippets.

@convenient
Last active February 4, 2019 11:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save convenient/ccd040ea5eaeebdd414405401c6c7cd4 to your computer and use it in GitHub Desktop.
Save convenient/ccd040ea5eaeebdd414405401c6c7cd4 to your computer and use it in GitHub Desktop.
Magento 2 Commerce patch files for staging unit test date bug

You can apply custom patch files as a post composer script

https://support.magento.com/hc/en-us/articles/360005484154-Create-a-patch-for-a-Magento-2-Composer-installation-from-a-GitHub-commit

Use the attached patch files to correct this issue.

mkdir -p patches/composer/magento/module-staging/
nano patches/composer/magento/module-staging/fix-staging-test.patch

Then add the following to your composer.json

    "extra": {
        "composer-exit-on-patch-failure": true,
        "patches": {
            "magento/module-staging": {
                "Fix broken staging unit test": "patches/composer/magento/module-staging/fix-staging-test.patch"
            }
        }
    }
--- Test/Unit/Model/Update/UpdateValidatorTest.php 2018-05-01 15:45:04.000000000 +0100
+++ Test/Unit/Model/Update/UpdateValidatorTest.php 2019-02-04 11:29:36.000000000 +0000
@@ -45,7 +45,7 @@
$updateId = 1;
$stagingData = [
'update_id' => $updateId,
- 'start_time' => '2019-02-02 02:02:02',
+ 'start_time' => '2038-01-19 03:00:00',
];
$updateMock = $this->getMock(UpdateInterface::class);
--- Test/Unit/Model/Update/UpdateValidatorTest.php 2018-09-06 13:34:28.000000000 +0100
+++ Test/Unit/Model/Update/UpdateValidatorTest.php 2019-02-04 10:46:17.000000000 +0000
@@ -46,7 +46,7 @@
$updateId = 1;
$stagingData = [
'update_id' => $updateId,
- 'start_time' => '2019-02-02 02:02:02',
+ 'start_time' => '2038-01-19 03:00:00',
];
$updateMock = $this->createMock(UpdateInterface::class);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment