Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
6749237d
Commit
6749237d
authored
Jul 31, 2014
by
catch
Browse files
Issue
#2309673
by mitsuroseba: Add tests for node/add when no node types exist.
parent
9e51810d
Changes
1
Show whitespace changes
Inline
Side-by-side
core/modules/node/src/Tests/NodeCreationTest.php
View file @
6749237d
...
...
@@ -158,4 +158,27 @@ public function testAuthorAutocomplete() {
$this
->
assertEqual
(
count
(
$result
),
1
,
'Ensure that the user does have access to the autocompletion'
);
}
/**
* Check node/add when no node types exist.
*/
function
testNodeAddWithoutContentTypes
()
{
$this
->
drupalGet
(
'node/add'
);
$this
->
assertResponse
(
200
);
$this
->
assertNoLinkByHref
(
'/admin/structure/types/add'
);
// Test /node/add page without content types.
foreach
(
entity_load_multiple
(
'node_type'
)
as
$entity
)
{
$entity
->
delete
();
}
$this
->
drupalGet
(
'node/add'
);
$this
->
assertResponse
(
403
);
$admin_content_types
=
$this
->
drupalCreateUser
(
array
(
'administer content types'
));
$this
->
drupalLogin
(
$admin_content_types
);
$this
->
drupalGet
(
'node/add'
);
$this
->
assertLinkByHref
(
'/admin/structure/types/add'
);
}
}
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