Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
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
drupal
Commits
a17c5355
Commit
a17c5355
authored
12 years ago
by
Angie Byron
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#1888700
by dawehner: Drop Drupal\views\Tests\Plugin\StyleTest::testLegacy().
parent
e7abb095
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!7452
Issue #1797438. HTML5 validation is preventing form submit and not fully...
,
!789
Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/modules/views/lib/Drupal/views/Tests/Plugin/StyleTest.php
+0
-91
0 additions, 91 deletions
...modules/views/lib/Drupal/views/Tests/Plugin/StyleTest.php
with
0 additions
and
91 deletions
core/modules/views/lib/Drupal/views/Tests/Plugin/StyleTest.php
+
0
−
91
View file @
a17c5355
...
...
@@ -89,97 +89,6 @@ public function testStyle() {
$this
->
assertTrue
(
strpos
(
$output
,
$random_text
)
!==
FALSE
,
'Take sure that the rendering of the row plugin appears in the output of the view.'
);
}
/**
* Tests the grouping legacy features of styles.
*/
function
testGroupingLegacy
()
{
$view
=
views_get_view
(
'test_view'
);
// Setup grouping by the job.
$view
->
setDisplay
();
$view
->
initStyle
();
$view
->
style_plugin
->
options
[
'grouping'
]
=
'job'
;
// Reduce the amount of items to make the test a bit easier.
// Set up the pager.
$view
->
displayHandlers
->
get
(
'default'
)
->
overrideOption
(
'pager'
,
array
(
'type'
=>
'some'
,
'options'
=>
array
(
'items_per_page'
=>
3
),
));
// Add the job field .
$view
->
displayHandlers
->
get
(
'default'
)
->
overrideOption
(
'fields'
,
array
(
'name'
=>
array
(
'id'
=>
'name'
,
'table'
=>
'views_test_data'
,
'field'
=>
'name'
,
'relationship'
=>
'none'
,
),
'job'
=>
array
(
'id'
=>
'job'
,
'table'
=>
'views_test_data'
,
'field'
=>
'job'
,
'relationship'
=>
'none'
,
),
));
// Now run the query and groupby the result.
$this
->
executeView
(
$view
);
// This is the old way to call it.
$sets
=
$view
->
style_plugin
->
render_grouping
(
$view
->
result
,
$view
->
style_plugin
->
options
[
'grouping'
]);
$expected
=
array
();
// Use Job: as label, so be sure that the label is used for groupby as well.
$expected
[
'Job: Singer'
]
=
array
();
$expected
[
'Job: Singer'
][
0
]
=
new
\stdClass
();
$expected
[
'Job: Singer'
][
0
]
->
views_test_data_name
=
'John'
;
$expected
[
'Job: Singer'
][
0
]
->
views_test_data_job
=
'Singer'
;
$expected
[
'Job: Singer'
][
0
]
->
views_test_data_id
=
'1'
;
$expected
[
'Job: Singer'
][
1
]
=
new
\stdClass
();
$expected
[
'Job: Singer'
][
1
]
->
views_test_data_name
=
'George'
;
$expected
[
'Job: Singer'
][
1
]
->
views_test_data_job
=
'Singer'
;
$expected
[
'Job: Singer'
][
1
]
->
views_test_data_id
=
'2'
;
$expected
[
'Job: Drummer'
]
=
array
();
$expected
[
'Job: Drummer'
][
2
]
=
new
\stdClass
();
$expected
[
'Job: Drummer'
][
2
]
->
views_test_data_name
=
'Ringo'
;
$expected
[
'Job: Drummer'
][
2
]
->
views_test_data_job
=
'Drummer'
;
$expected
[
'Job: Drummer'
][
2
]
->
views_test_data_id
=
'3'
;
$this
->
assertEqual
(
$sets
,
$expected
,
t
(
'The style plugin should proper group the results with grouping by the rendered output.'
));
$expected
=
array
();
$expected
[
'Job: Singer'
]
=
array
();
$expected
[
'Job: Singer'
][
'group'
]
=
'Job: Singer'
;
$expected
[
'Job: Singer'
][
'rows'
][
0
]
=
new
\stdClass
();
$expected
[
'Job: Singer'
][
'rows'
][
0
]
->
views_test_data_name
=
'John'
;
$expected
[
'Job: Singer'
][
'rows'
][
0
]
->
views_test_data_job
=
'Singer'
;
$expected
[
'Job: Singer'
][
'rows'
][
0
]
->
views_test_data_id
=
'1'
;
$expected
[
'Job: Singer'
][
'rows'
][
1
]
=
new
\stdClass
();
$expected
[
'Job: Singer'
][
'rows'
][
1
]
->
views_test_data_name
=
'George'
;
$expected
[
'Job: Singer'
][
'rows'
][
1
]
->
views_test_data_job
=
'Singer'
;
$expected
[
'Job: Singer'
][
'rows'
][
1
]
->
views_test_data_id
=
'2'
;
$expected
[
'Job: Drummer'
]
=
array
();
$expected
[
'Job: Drummer'
][
'group'
]
=
'Job: Drummer'
;
$expected
[
'Job: Drummer'
][
'rows'
][
2
]
=
new
\stdClass
();
$expected
[
'Job: Drummer'
][
'rows'
][
2
]
->
views_test_data_name
=
'Ringo'
;
$expected
[
'Job: Drummer'
][
'rows'
][
2
]
->
views_test_data_job
=
'Drummer'
;
$expected
[
'Job: Drummer'
][
'rows'
][
2
]
->
views_test_data_id
=
'3'
;
// The newer api passes the value of the grouping as well.
$sets_new_rendered
=
$view
->
style_plugin
->
render_grouping
(
$view
->
result
,
$view
->
style_plugin
->
options
[
'grouping'
],
TRUE
);
$sets_new_value
=
$view
->
style_plugin
->
render_grouping
(
$view
->
result
,
$view
->
style_plugin
->
options
[
'grouping'
],
FALSE
);
$this
->
assertEqual
(
$sets_new_rendered
,
$expected
,
t
(
'The style plugins should proper group the results with grouping by the rendered output.'
));
// Reorder the group structure to group by value.
$expected
[
'Singer'
]
=
$expected
[
'Job: Singer'
];
$expected
[
'Drummer'
]
=
$expected
[
'Job: Drummer'
];
unset
(
$expected
[
'Job: Singer'
]);
unset
(
$expected
[
'Job: Drummer'
]);
$this
->
assertEqual
(
$sets_new_value
,
$expected
,
t
(
'The style plugins should proper group the results with grouping by the value.'
));
}
function
testGrouping
()
{
$this
->
_testGrouping
(
FALSE
);
$this
->
_testGrouping
(
TRUE
);
...
...
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