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
294
Merge Requests
294
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
dedaf33c
Commit
dedaf33c
authored
Dec 05, 2014
by
alexpott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2385805
by Gábor Hojtsy: Views tests don't pass strict schema checking
parent
502c78a6
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
136 additions
and
17 deletions
+136
-17
core/modules/comment/tests/modules/comment_test_views/test_views/views.view.test_field_filters.yml
...t_test_views/test_views/views.view.test_field_filters.yml
+1
-0
core/modules/node/tests/modules/node_test_views/test_views/views.view.test_field_filters.yml
...e_test_views/test_views/views.view.test_field_filters.yml
+6
-1
core/modules/views/config/schema/views.access.schema.yml
core/modules/views/config/schema/views.access.schema.yml
+1
-3
core/modules/views/config/schema/views.schema.yml
core/modules/views/config/schema/views.schema.yml
+7
-1
core/modules/views/src/Tests/Handler/AreaTest.php
core/modules/views/src/Tests/Handler/AreaTest.php
+1
-0
core/modules/views/src/Tests/Plugin/BlockDependenciesTest.php
.../modules/views/src/Tests/Plugin/BlockDependenciesTest.php
+4
-3
core/modules/views/src/Tests/ViewElementTest.php
core/modules/views/src/Tests/ViewElementTest.php
+3
-2
core/modules/views/src/Tests/ViewStorageTest.php
core/modules/views/src/Tests/ViewStorageTest.php
+4
-6
core/modules/views/src/Tests/ViewTestBase.php
core/modules/views/src/Tests/ViewTestBase.php
+9
-0
core/modules/views/src/Tests/ViewUnitTestBase.php
core/modules/views/src/Tests/ViewUnitTestBase.php
+9
-0
core/modules/views/tests/modules/views_test_config/test_views/views.view.test_display_defaults.yml
...st_config/test_views/views.view.test_display_defaults.yml
+1
-0
core/modules/views/tests/modules/views_test_config/test_views/views.view.test_views_groupby_save.yml
..._config/test_views/views.view.test_views_groupby_save.yml
+1
-1
core/modules/views/tests/modules/views_test_data/config/schema/views_test_data.views.schema.yml
..._test_data/config/schema/views_test_data.views.schema.yml
+59
-0
core/modules/views_ui/src/Tests/CustomBooleanTest.php
core/modules/views_ui/src/Tests/CustomBooleanTest.php
+2
-0
core/modules/views_ui/src/Tests/DisplayCRUDTest.php
core/modules/views_ui/src/Tests/DisplayCRUDTest.php
+11
-0
core/modules/views_ui/src/Tests/DisplayExtenderUITest.php
core/modules/views_ui/src/Tests/DisplayExtenderUITest.php
+11
-0
core/modules/views_ui/src/Tests/QueryTest.php
core/modules/views_ui/src/Tests/QueryTest.php
+6
-0
No files found.
core/modules/comment/tests/modules/comment_test_views/test_views/views.view.test_field_filters.yml
View file @
dedaf33c
...
...
@@ -100,6 +100,7 @@ display:
empty
:
'
'
hide_alter_empty
:
true
link_to_entity
:
false
plugin_id
:
comment
filters
:
subject
:
id
:
subject
...
...
core/modules/node/tests/modules/node_test_views/test_views/views.view.test_field_filters.yml
View file @
dedaf33c
...
...
@@ -73,7 +73,7 @@ display:
html
:
false
hide_empty
:
false
empty_zero
:
false
link_to_node
:
1
link_to_node
:
true
relationship
:
none
group_type
:
group
admin_label
:
'
'
...
...
@@ -88,6 +88,7 @@ display:
element_default_classes
:
true
empty
:
'
'
hide_alter_empty
:
true
plugin_id
:
node
filters
:
status
:
value
:
true
...
...
@@ -97,6 +98,7 @@ display:
expose
:
operator
:
'
'
group
:
1
plugin_id
:
boolean
title
:
id
:
title
table
:
node_field_data
...
...
@@ -179,6 +181,7 @@ display:
expose
:
operator
:
'
'
group
:
1
plugin_id
:
boolean
body_value
:
id
:
body_value
table
:
node__body
...
...
@@ -243,6 +246,7 @@ display:
expose
:
operator
:
'
'
group
:
1
plugin_id
:
boolean
body_value
:
id
:
body_value
table
:
node__body
...
...
@@ -307,6 +311,7 @@ display:
expose
:
operator
:
'
'
group
:
1
plugin_id
:
boolean
title
:
id
:
title
table
:
node_field_data
...
...
core/modules/views/config/schema/views.access.schema.yml
View file @
dedaf33c
# Schema for the views access plugins.
views.access.none
:
type
:
sequence
type
:
mapping
label
:
'
None'
sequence
:
-
type
:
string
core/modules/views/config/schema/views.schema.yml
View file @
dedaf33c
...
...
@@ -115,7 +115,7 @@ views.view.*:
display_options
:
type
:
views.display.[%parent.display_plugin]
block.settings.views_block:*
:
views_block
:
type
:
block_settings
label
:
'
View
block'
mapping
:
...
...
@@ -125,3 +125,9 @@ block.settings.views_block:*:
items_per_page
:
type
:
string
label
:
'
Items
per
block'
block.settings.views_block:*:
type
:
views_block
block.settings.views_exposed_filter_block:*:
type
:
views_block
core/modules/views/src/Tests/Handler/AreaTest.php
View file @
dedaf33c
...
...
@@ -166,6 +166,7 @@ public function testTitleArea() {
'admin_label'
=>
''
,
'empty'
=>
'0'
,
'title'
=>
'Overridden title'
,
'plugin_id'
=>
'title'
,
),
));
...
...
core/modules/views/src/Tests/Plugin/BlockDependenciesTest.php
View file @
dedaf33c
...
...
@@ -100,13 +100,14 @@ protected function createBlock($plugin_id, array $settings = array()) {
'max_age'
=>
0
,
),
);
foreach
(
array
(
'region'
,
'id'
,
'theme'
,
'plugin'
,
'weight'
)
as
$key
)
{
$values
=
[];
foreach
(
array
(
'region'
,
'id'
,
'theme'
,
'plugin'
,
'weight'
,
'visibility'
)
as
$key
)
{
$values
[
$key
]
=
$settings
[
$key
];
// Remove extra values that do not belong in the settings array.
unset
(
$settings
[
$key
]);
}
foreach
(
$
setting
s
[
'visibility'
]
as
$id
=>
$visibility
)
{
$
setting
s
[
'visibility'
][
$id
][
'id'
]
=
$id
;
foreach
(
$
value
s
[
'visibility'
]
as
$id
=>
$visibility
)
{
$
value
s
[
'visibility'
][
$id
][
'id'
]
=
$id
;
}
$values
[
'settings'
]
=
$settings
;
$block
=
entity_create
(
'block'
,
$values
);
...
...
core/modules/views/src/Tests/ViewElementTest.php
View file @
dedaf33c
...
...
@@ -89,11 +89,12 @@ public function testViewElement() {
'type'
=>
'none'
,
'fail'
=>
'not found'
,
),
'break_phrase'
=>
0
,
'not'
=>
0
,
'break_phrase'
=>
FALSE
,
'not'
=>
FALSE
,
'id'
=>
'age'
,
'table'
=>
'views_test_data'
,
'field'
=>
'age'
,
'plugin_id'
=>
'numeric'
,
)
));
$view
->
save
();
...
...
core/modules/views/src/Tests/ViewStorageTest.php
View file @
dedaf33c
...
...
@@ -233,14 +233,12 @@ protected function displayMethodTests() {
$this
->
assertEqual
(
$display
[
$id
][
'display_title'
],
'Page 3'
);
// Ensure the 'default' display always has position zero, regardless of when
// it was created relative to other displays.
$displays
=
$view
->
get
(
'display'
);
$displays
[
'default'
][
'deleted'
]
=
TRUE
;
$view
->
set
(
'display'
,
$displays
);
$view
->
set
(
'id'
,
$this
->
randomMachineName
());
$view
->
save
();
// it was set relative to other displays. Even if the 'default' display
// exists, adding it again will overwrite it, which is asserted with the new
// title.
$view
->
addDisplay
(
'default'
,
$random_title
);
$displays
=
$view
->
get
(
'display'
);
$this
->
assertEqual
(
$displays
[
'default'
][
'display_title'
],
$random_title
,
'Default display is defined with the new title'
);
$this
->
assertEqual
(
$displays
[
'default'
][
'position'
],
0
,
'Default displays are always in position zero'
);
// Tests Drupal\views\Entity\View::generateDisplayId().
...
...
core/modules/views/src/Tests/ViewTestBase.php
View file @
dedaf33c
...
...
@@ -23,6 +23,15 @@
*/
abstract
class
ViewTestBase
extends
WebTestBase
{
/**
* Set to TRUE to strict check all configuration saved.
*
* @see \Drupal\Core\Config\Testing\ConfigSchemaChecker
*
* @var bool
*/
protected
$strictConfigSchema
=
TRUE
;
/**
* Modules to enable.
*
...
...
core/modules/views/src/Tests/ViewUnitTestBase.php
View file @
dedaf33c
...
...
@@ -24,6 +24,15 @@
*/
abstract
class
ViewUnitTestBase
extends
KernelTestBase
{
/**
* Set to TRUE to strict check all configuration saved.
*
* @see \Drupal\Core\Config\Testing\ConfigSchemaChecker
*
* @var bool
*/
protected
$strictConfigSchema
=
TRUE
;
/**
* Modules to enable.
*
...
...
core/modules/views/tests/modules/views_test_config/test_views/views.view.test_display_defaults.yml
View file @
dedaf33c
...
...
@@ -48,5 +48,6 @@ display:
table
:
views_test_data
field
:
created
order
:
DESC
plugin_id
:
date
field_langcode
:
'
***LANGUAGE_language_content***'
field_langcode_add_to_query
:
null
core/modules/views/tests/modules/views_test_config/test_views/views.view.test_views_groupby_save.yml
View file @
dedaf33c
...
...
@@ -29,7 +29,7 @@ display:
field
:
id
table
:
views_test_data
id
:
id
plugin_id
:
id
plugin_id
:
numeric
field_langcode
:
'
***LANGUAGE_language_content***'
field_langcode_add_to_query
:
null
display_plugin
:
default
...
...
core/modules/views/tests/modules/views_test_data/config/schema/views_test_data.views.schema.yml
View file @
dedaf33c
...
...
@@ -26,3 +26,62 @@ views.style.mapping_test:
toggle_title_field
:
type
:
boolean
label
:
'
Toggle
title
field'
views_test_data.tests
:
type
:
mapping
label
:
'
Views
test
data
tests'
mapping
:
handler_access_callback
:
type
:
boolean
label
:
'
Access
callback
handler
toggle'
handler_access_callback_argument
:
type
:
boolean
label
:
'
Access
callback
argument
handler
toggle'
views.access.test_static
:
type
:
mapping
label
:
'
Static
test'
mapping
:
access
:
type
:
boolean
label
:
'
Allow
access'
views.display.display_test
:
type
:
views_display
label
:
'
Test
display
options'
mapping
:
test_option
:
label
:
'
Test
option'
type
:
string
views.display.invalid
:
type
:
views.display.page
label
:
'
Invalid
display'
views.display.display_no_area_test
:
type
:
views.display.display_test
label
:
'
Test
display
options
without
areas'
views.query.query_test
:
type
:
views_query
label
:
'
Views
query
test
options'
mapping
:
test_setting
:
type
:
string
label
:
'
Test
setting'
views.row.test_row
:
type
:
views_entity_row
label
:
'
Row
test
options'
mapping
:
test_option
:
type
:
string
label
:
'
Test
option'
views.style.test_style
:
type
:
views_style
label
:
'
Test
style
options'
mapping
:
test_option
:
type
:
string
label
:
'
Test
option'
core/modules/views_ui/src/Tests/CustomBooleanTest.php
View file @
dedaf33c
...
...
@@ -57,8 +57,10 @@ public function testCustomOption() {
'table'
=>
'views_test_data'
,
'field'
=>
'age'
,
'relationship'
=>
'none'
,
'plugin_id'
=>
'boolean'
,
),
));
$view
->
save
();
$this
->
executeView
(
$view
);
...
...
core/modules/views_ui/src/Tests/DisplayCRUDTest.php
View file @
dedaf33c
...
...
@@ -16,6 +16,17 @@
*/
class
DisplayCRUDTest
extends
UITestBase
{
/**
* Set to TRUE to strict check all configuration saved.
*
* @see \Drupal\Core\Config\Testing\ConfigSchemaChecker
*
* @todo https://www.drupal.org/node/2387157
*
* @var bool
*/
protected
$strictConfigSchema
=
FALSE
;
/**
* Views used by this test.
*
...
...
core/modules/views_ui/src/Tests/DisplayExtenderUITest.php
View file @
dedaf33c
...
...
@@ -16,6 +16,17 @@
*/
class
DisplayExtenderUITest
extends
UITestBase
{
/**
* Set to TRUE to strict check all configuration saved.
*
* @see \Drupal\Core\Config\Testing\ConfigSchemaChecker
*
* @todo https://www.drupal.org/node/2387149
*
* @var bool
*/
protected
$strictConfigSchema
=
FALSE
;
/**
* Views used by this test.
*
...
...
core/modules/views_ui/src/Tests/QueryTest.php
View file @
dedaf33c
...
...
@@ -8,6 +8,7 @@
namespace
Drupal\views_ui\Tests
;
use
Drupal\views\Views
;
use
Drupal\views\Entity\View
;
use
Drupal\views\Tests\ViewTestBase
;
use
Drupal\views_test_data
\
Plugin\views\query\QueryTest
as
QueryTestPlugin
;
...
...
@@ -39,6 +40,11 @@ protected function viewsData() {
* Tests query plugins settings.
*/
public
function
testQueryUI
()
{
$view
=
View
::
load
(
'test_view'
);
$display
=
&
$view
->
getDisplay
(
'default'
);
$display
[
'display_options'
][
'query'
]
=
[
'type'
=>
'query_test'
];
$view
->
save
();
// Save some query settings.
$query_settings_path
=
"admin/structure/views/nojs/display/test_view/default/query"
;
$random_value
=
$this
->
randomMachineName
();
...
...
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