Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal-3338541
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Issue forks
drupal-3338541
Commits
09369068
Commit
09369068
authored
12 years ago
by
Damian Lee
Committed by
Tim Plunkett
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#1780228
by damiankloip: Make sure that position is on ViewDisplay objects.
parent
712b4b90
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/Drupal/views/Tests/ViewStorageTest.php
+11
-5
11 additions, 5 deletions
lib/Drupal/views/Tests/ViewStorageTest.php
lib/Drupal/views/ViewDisplay.php
+8
-0
8 additions, 0 deletions
lib/Drupal/views/ViewDisplay.php
with
19 additions
and
5 deletions
lib/Drupal/views/Tests/ViewStorageTest.php
+
11
−
5
View file @
09369068
...
...
@@ -92,6 +92,7 @@ function testConfigurationEntityCRUD() {
*/
protected
function
loadTests
()
{
$view
=
$this
->
loadView
(
'archive'
);
$data
=
config
(
'views.view.archive'
)
->
get
();
// Confirm that an actual view object is loaded and that it returns all of
// expected properties.
...
...
@@ -104,13 +105,18 @@ protected function loadTests() {
$expected_displays
=
array
(
'default'
,
'page'
,
'block'
);
$this
->
assertEqual
(
array_keys
(
$view
->
display
),
$expected_displays
,
'The correct display names are present.'
);
// Check each ViewDisplay object and confirm that it has the correct key.
// Check each ViewDisplay object and confirm that it has the correct key and
// property values.
foreach
(
$view
->
display
as
$key
=>
$display
)
{
$this
->
assertTrue
(
$display
instanceof
ViewDisplay
,
format_string
(
'Display: @display is instance of ViewDisplay.'
,
array
(
'@display'
=>
$key
)));
$this
->
assertEqual
(
$key
,
$display
->
id
,
'The display has the correct ID.'
);
// Confirm that the display options array exists.
$display_options
=
$display
->
display_options
;
$this
->
assertTrue
(
!
empty
(
$display_options
)
&&
is_array
(
$display_options
),
'Display options exist.'
);
$this
->
assertEqual
(
$key
,
$display
->
id
,
'The display has the correct ID assigned.'
);
// Get original display data and confirm that the display options array
// exists.
$original_options
=
$data
[
'display'
][
$key
];
foreach
(
$original_options
as
$orig_key
=>
$value
)
{
$this
->
assertIdentical
(
$display
->
{
$orig_key
},
$value
,
format_string
(
'@key is identical to saved data'
,
array
(
'@key'
=>
$key
)));
}
}
// Fetch data for all configuration entities and default view configurations.
...
...
This diff is collapsed.
Click to expand it.
lib/Drupal/views/ViewDisplay.php
+
8
−
0
View file @
09369068
...
...
@@ -50,6 +50,13 @@ class ViewDisplay {
*/
public
$display_title
;
/**
* The position (weight) of the display.
*
* @var int
*/
public
$position
;
/**
* Constructs a ViewDisplay object.
*
...
...
@@ -86,6 +93,7 @@ public function __construct(array $values = array()) {
$this
->
display_plugin
=
$values
[
'display_plugin'
];
$this
->
id
=
$values
[
'id'
];
$this
->
display_title
=
$values
[
'display_title'
];
$this
->
position
=
$values
[
'position'
];
}
}
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