Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
automatic_updates
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
automatic_updates
Merge requests
!214
Issue
#3248929
: List update that will be applied on the UpdateReady form
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Issue
#3248929
: List update that will be applied on the UpdateReady form
issue/automatic_updates-3248929:3248929-list-update-that
into
8.x-2.x
Overview
32
Commits
21
Pipelines
0
Changes
10
1 unresolved thread
Show all comments
Merged
Kunal Sachdev
requested to merge
issue/automatic_updates-3248929:3248929-list-update-that
into
8.x-2.x
3 years ago
Overview
32
Commits
21
Pipelines
0
Changes
10
1 unresolved thread
Show all comments
Expand
0
0
Merge request reports
Compare
8.x-2.x
version 17
50a71c67
3 years ago
version 16
ebb0ed81
3 years ago
version 15
a7805fcd
3 years ago
version 14
f82271de
3 years ago
version 13
a8cae336
3 years ago
version 12
71d50203
3 years ago
version 11
b9bb3de8
3 years ago
version 10
ee1bf9f8
3 years ago
version 9
30f9b9a0
3 years ago
version 8
9606b4d2
3 years ago
version 7
1c526f5a
3 years ago
version 6
0120cf93
3 years ago
version 5
fadef164
3 years ago
version 4
39abfa3d
3 years ago
version 3
ff63ac8b
3 years ago
version 2
00c35126
3 years ago
version 1
3086820d
3 years ago
8.x-2.x (base)
and
latest version
latest version
50a71c67
21 commits,
3 years ago
version 17
50a71c67
21 commits,
3 years ago
version 16
ebb0ed81
20 commits,
3 years ago
version 15
a7805fcd
19 commits,
3 years ago
version 14
f82271de
18 commits,
3 years ago
version 13
a8cae336
17 commits,
3 years ago
version 12
71d50203
15 commits,
3 years ago
version 11
b9bb3de8
14 commits,
3 years ago
version 10
ee1bf9f8
12 commits,
3 years ago
version 9
30f9b9a0
11 commits,
3 years ago
version 8
9606b4d2
10 commits,
3 years ago
version 7
1c526f5a
9 commits,
3 years ago
version 6
0120cf93
8 commits,
3 years ago
version 5
fadef164
7 commits,
3 years ago
version 4
39abfa3d
6 commits,
3 years ago
version 3
ff63ac8b
5 commits,
3 years ago
version 2
00c35126
2 commits,
3 years ago
version 1
3086820d
1 commit,
3 years ago
10 files
+
238
−
32
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
10
Search (e.g. *.vue) (Ctrl+P)
package_manager/tests/modules/package_manager_test_fixture/src/EventSubscriber/FixtureStager.php
0 → 100644
+
88
−
0
Options
<?php
namespace
Drupal\package_manager_test_fixture\EventSubscriber
;
use
Drupal\Core\State\StateInterface
;
use
Drupal\package_manager
\Event\PostRequireEvent
;
use
Symfony\Component\EventDispatcher\EventSubscriberInterface
;
use
Symfony\Component\Filesystem\Filesystem
;
/**
* Defines an event subscriber which copies certain files into the staging area.
*
* This is most useful in conjunction with package_manager_bypass, which quietly
* turns all Composer Stager operations into no-ops. In such cases, no staging
* area will be physically created, but if a test needs to simulate certain
* conditions in a staging area without actually staging the active code base,
* this event subscriber is the way to do it.
*/
class
FixtureStager
implements
EventSubscriberInterface
{
/**
* The state service.
*
* @var \Drupal\Core\State\StateInterface
*/
protected
$state
;
/**
* The Symfony file system service.
*
* @var \Symfony\Component\Filesystem\Filesystem
*/
protected
$fileSystem
;
/**
* Constructs a FixtureStager.
*
* @param \Drupal\Core\State\StateInterface $state
* The state service.
* @param \Symfony\Component\Filesystem\Filesystem $file_system
* The Symfony file system service.
*/
public
function
__construct
(
StateInterface
$state
,
Filesystem
$file_system
)
{
$this
->
state
=
$state
;
$this
->
fileSystem
=
$file_system
;
}
/**
* Copies files from a fixture into the staging area.
*
* Tests which use this functionality are responsible for cleaning up the
* staging area.
*
* @param \Drupal\package_manager\Event\PostRequireEvent $event
* The event object.
*
* @see \Drupal\Tests\automatic_updates\Functional\AutomaticUpdatesFunctionalTestBase::tearDown()
*/
public
function
copyFilesFromFixture
(
PostRequireEvent
$event
):
void
{
$fixturePath
=
$this
->
state
->
get
(
static
::
class
);
if
(
$fixturePath
&&
is_dir
(
$fixturePath
))
{
$this
->
fileSystem
->
mirror
(
$fixturePath
,
$event
->
getStage
()
->
getStageDirectory
(),
NULL
,
[
'override'
=>
TRUE
,
'delete'
=>
TRUE
,
]);
}
}
/**
* {@inheritdoc}
*/
public
static
function
getSubscribedEvents
()
{
return
[
PostRequireEvent
::
class
=>
'copyFilesFromFixture'
,
];
}
/**
* Sets the path of the fixture to copy into the staging area.
*
* @param string $path
* The path of the fixture to copy into the staging area.
*/
public
static
function
setFixturePath
(
string
$path
):
void
{
\Drupal
::
state
()
->
set
(
static
::
class
,
$path
);
}
}
Loading