Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal-3485117
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-3485117
Commits
65b1a47c
Commit
65b1a47c
authored
12 years ago
by
Damian Lee
Committed by
Tim Plunkett
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
use format_patch instead of t, Added create tests
parent
34b980b3
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/Drupal/views/Tests/ViewsStorageTest.php
+23
-3
23 additions, 3 deletions
lib/Drupal/views/Tests/ViewsStorageTest.php
with
23 additions
and
3 deletions
lib/Drupal/views/Tests/ViewsStorageTest.php
+
23
−
3
View file @
65b1a47c
...
...
@@ -71,7 +71,7 @@ function testConfigurableCRUD() {
// expected properties.
$this
->
assertTrue
(
$view
instanceof
View
,
'Single View instance loaded.'
);
foreach
(
$this
->
config_properties
as
$property
)
{
$this
->
assertTrue
(
isset
(
$view
->
{
$property
}),
t
(
'Property: @property loaded onto View.'
,
array
(
'@property'
=>
$property
)));
$this
->
assertTrue
(
isset
(
$view
->
{
$property
}),
format_string
(
'Property: @property loaded onto View.'
,
array
(
'@property'
=>
$property
)));
}
// Check the displays have been loaded correctly from config display data.
...
...
@@ -80,7 +80,7 @@ function testConfigurableCRUD() {
// Check each ViewDisplay object and confirm that it has the correct key.
foreach
(
$view
->
display
as
$key
=>
$display
)
{
$this
->
assertTrue
(
$display
instanceof
ViewsDisplay
,
t
(
'Display: @display is instance of ViewsDisplay.'
,
array
(
'@display'
=>
$key
)));
$this
->
assertTrue
(
$display
instanceof
ViewsDisplay
,
format_string
(
'Display: @display is instance of ViewsDisplay.'
,
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
;
...
...
@@ -100,10 +100,30 @@ function testConfigurableCRUD() {
// Check that the correct number of Configurable objects have been loaded.
$count
=
count
(
$all_configurables
);
$this
->
assertEqual
(
$count
,
count
(
$all_config
),
t
(
'The array of all @count Configurable objects is loaded.'
,
array
(
'@count'
=>
$count
)));
$this
->
assertEqual
(
$count
,
count
(
$all_config
),
format_string
(
'The array of all @count Configurable objects is loaded.'
,
array
(
'@count'
=>
$count
)));
// Check that all of these machine names match.
$this
->
assertIdentical
(
array_keys
(
$all_configurables
),
array_map
(
$prefix_map
,
$all_config
),
'All loaded elements match.'
);
// Create a new View instance with empty values.
$created
=
$controller
->
create
(
array
());
$this
->
assertTrue
(
$created
instanceof
View
,
'Created object is a View.'
);
// Check that the View contains all of the properties.
foreach
(
$this
->
config_properties
as
$property
)
{
$this
->
assertTrue
(
isset
(
$view
->
{
$property
}),
format_string
(
'Property: @property created on View.'
,
array
(
'@property'
=>
$property
)));
}
// Create a new View instance with config values.
$values
=
config
(
'views.view.archive'
)
->
get
();
$created
=
$controller
->
create
(
$values
);
$this
->
assertTrue
(
$created
instanceof
View
,
'Created object is a View.'
);
// Check that the View contains all of the properties.
foreach
(
$this
->
config_properties
as
$property
)
{
$this
->
assertTrue
(
isset
(
$view
->
{
$property
}),
format_string
(
'Property: @property created on View.'
,
array
(
'@property'
=>
$property
)));
$this
->
assertIdentical
(
$values
[
$property
],
$created
->
{
$property
},
format_string
(
'Property value: @property matches configuration value.'
,
array
(
'@property'
=>
$property
)));
}
}
}
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