Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
digit-joinup-reference
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ec-europa
digit-joinup-reference
Commits
b85bc954
Commit
b85bc954
authored
5 months ago
by
Claudiu Cristea
Browse files
Options
Downloads
Patches
Plain Diff
ISAICP-9218: Re-synchonize terms for some tests.
parent
20c1d544
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!200
Security release 2.0.4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/features/adms_ap_compliance.feature
+1
-1
1 addition, 1 deletion
tests/features/adms_ap_compliance.feature
tests/src/Context/RdfContext.php
+21
-0
21 additions, 0 deletions
tests/src/Context/RdfContext.php
with
22 additions
and
1 deletion
tests/features/adms_ap_compliance.feature
+
1
−
1
View file @
b85bc954
@api
@api
@rdf_sync
Feature
:
Interoperable Europe Portal should be ADMS-AP compliant.
Feature
:
Interoperable Europe Portal should be ADMS-AP compliant.
Scenario
:
Validate the entities in the published graph.
Scenario
:
Validate the entities in the published graph.
...
...
This diff is collapsed.
Click to expand it.
tests/src/Context/RdfContext.php
+
21
−
0
View file @
b85bc954
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
use
Behat\Gherkin\Node\TableNode
;
use
Behat\Gherkin\Node\TableNode
;
use
Drupal\DrupalExtension\Context\RawDrupalContext
;
use
Drupal\DrupalExtension\Context\RawDrupalContext
;
use
Drupal\rdf_sync
\Model\SyncMethod
;
use
PHPUnit\Framework\Assert
;
use
PHPUnit\Framework\Assert
;
use
PHPUnit\Framework\ExpectationFailedException
;
use
PHPUnit\Framework\ExpectationFailedException
;
use
function
PHPUnit\Framework\assertCount
;
use
function
PHPUnit\Framework\assertCount
;
...
@@ -235,6 +236,26 @@ public function assertValidPublishedGraph(): void {
...
@@ -235,6 +236,26 @@ public function assertValidPublishedGraph(): void {
Assert
::
assertTrue
(
$result
->
isSuccessful
(),
'The published graph is not ADMS-AP compliant.'
);
Assert
::
assertTrue
(
$result
->
isSuccessful
(),
'The published graph is not ADMS-AP compliant.'
);
}
}
/**
* Re-synchronizes terms.
*
* Used in Digit QA pipeline. The terms are installed and synchronized in
* clean-install job but are not preserved between jobs. Tests requiring RDF
* synchronized terms, should be tagged with @rdf_sync.
*
* @BeforeScenario @rdf_sync&&@api
*/
public
function
reSynchronizeTerms
():
void
{
$info
=
\Drupal
::
getContainer
()
->
get
(
'entity_type.bundle.info'
)
->
getBundleInfo
(
'taxonomy_term'
);
$vids
=
array_filter
(
$info
,
fn
(
array
$bundle
):
bool
=>
isset
(
$bundle
[
'rdf_sync'
]));
$tids
=
\Drupal
::
entityQuery
(
'taxonomy_term'
)
->
accessCheck
(
FALSE
)
->
condition
(
'vid'
,
array_keys
(
$vids
),
'IN'
)
->
execute
();
/** @var \Drupal\taxonomy\TermInterface[] $terms */
$terms
=
\Drupal
::
entityTypeManager
()
->
getStorage
(
'taxonomy_term'
)
->
loadMultiple
(
$tids
);
\Drupal
::
getContainer
()
->
get
(
'rdf_sync.synchronizer'
)
->
synchronize
(
SyncMethod
::
UPDATE
,
$terms
);
}
/**
/**
* Updates an entity, given its RDF resource (URI).
* Updates an entity, given its RDF resource (URI).
*
*
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment