Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
313
Merge Requests
313
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
749f7ea1
Commit
749f7ea1
authored
May 08, 2014
by
catch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2254211
by sun: Fix test performance of Drupal\taxonomy\Tests\LegacyTest.
parent
6ae2108c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
1 deletion
+43
-1
core/modules/taxonomy/lib/Drupal/taxonomy/Tests/LegacyTest.php
...modules/taxonomy/lib/Drupal/taxonomy/Tests/LegacyTest.php
+43
-1
No files found.
core/modules/taxonomy/lib/Drupal/taxonomy/Tests/LegacyTest.php
View file @
749f7ea1
...
...
@@ -8,13 +8,19 @@
namespace
Drupal\taxonomy\Tests
;
use
Drupal\Core\Datetime\DrupalDateTime
;
use
Drupal\Core\Field\FieldDefinitionInterface
;
/**
* Test for legacy node bug.
*/
class
LegacyTest
extends
TaxonomyTestBase
{
protected
$profile
=
'standard'
;
/**
* Modules to enable.
*
* @var array
*/
public
static
$modules
=
array
(
'node'
,
'datetime'
);
public
static
function
getInfo
()
{
return
array
(
...
...
@@ -26,6 +32,42 @@ public static function getInfo() {
function
setUp
()
{
parent
::
setUp
();
// Create a tags vocabulary for the 'article' content type.
$vocabulary
=
entity_create
(
'taxonomy_vocabulary'
,
array
(
'name'
=>
'Tags'
,
'vid'
=>
'tags'
,
));
$vocabulary
->
save
();
$field_name
=
'field_'
.
$vocabulary
->
id
();
entity_create
(
'field_config'
,
array
(
'name'
=>
$field_name
,
'entity_type'
=>
'node'
,
'type'
=>
'taxonomy_term_reference'
,
'cardinality'
=>
FieldDefinitionInterface
::
CARDINALITY_UNLIMITED
,
'settings'
=>
array
(
'allowed_values'
=>
array
(
array
(
'vocabulary'
=>
$vocabulary
->
id
(),
'parent'
=>
0
,
),
),
),
))
->
save
();
entity_create
(
'field_instance_config'
,
array
(
'entity_type'
=>
'node'
,
'field_name'
=>
$field_name
,
'bundle'
=>
'article'
,
'label'
=>
'Tags'
,
))
->
save
();
entity_get_form_display
(
'node'
,
'article'
,
'default'
)
->
setComponent
(
$field_name
,
array
(
'type'
=>
'taxonomy_autocomplete'
,
))
->
save
();
$this
->
admin_user
=
$this
->
drupalCreateUser
(
array
(
'administer taxonomy'
,
'administer nodes'
,
'bypass node access'
));
$this
->
drupalLogin
(
$this
->
admin_user
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment