Registry /
testing / weitzman-drupal-test-traits
Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
ContentTypeCreationTrait
✓ use Drupal\Tests\Traits\Content\ContentTypeCreationTrait;
Create a content type and test its page in a Drupal functional test.
use Drupal\Tests\Traits\Content\ContentTypeCreationTrait;
class MyTest extends \Drupal\Tests\BrowserTestBase {
use ContentTypeCreationTrait;
public function testContentType() {
$this->createContentType(['type' => 'article']);
$this->drupalGet('/node/add/article');
$this->assertSession()->statusCodeEquals(200);
}
}
Debug
Known issues
No known issues recorded.
Audit
Dependencies
No dependency data recorded yet.