protected function RangeBaseWebTestCase::createTestContentType in Range 7
Creates a new content type.
Drupal core drupalCreateContentType() method of DrupalWebTestCase class creates too much "noise". This is much simpler version of it.
4 calls to RangeBaseWebTestCase::createTestContentType()
- RangeFieldUIWebTestCase::setUp in tests/
range.field_ui.test - Sets up a Drupal site for running functional and integration tests.
- RangeFieldWidgetTestCase::setUp in tests/
range.field_widget.test - Sets up a Drupal site for running functional and integration tests.
- RangeFieldWidgetValidationTestCase::setUp in tests/
range.field_widget_validation.test - Sets up a Drupal site for running functional and integration tests.
- RangeInternationalizationWebTestCase::setUp in tests/
range.i18n.test - Sets up a Drupal site for running functional and integration tests.
File
- tests/
range.base.test, line 102 - Contains range base test classes.
Class
- RangeBaseWebTestCase
- Base class for the range module's tests.
Code
protected function createTestContentType() {
$content_type = new stdClass();
$content_type->type = $this->contentType;
$content_type->name = $this->contentType;
$content_type->base = 'node_content';
$content_type->custom = 1;
$content_type->locked = 0;
$content_type->modified = 1;
node_type_save($content_type);
node_types_rebuild();
menu_rebuild();
// Reset permissions so that permissions for this content type are available.
$this
->checkPermissions(array(), TRUE);
}