/** * {@inheritdoc} */ protected function setUp() { parent::setUp(); EnhancedEntityBundle::create(['id' => 'default', 'label' => 'Default'])->save(); $this->account = $this->drupalCreateUser(['administer entity_test_enhanced']); $this->drupalLogin($this->account); }
/** * {@inheritdoc} */ protected function setUp() { parent::setUp(); $this->installEntitySchema('user'); $this->installSchema('system', 'sequences'); $bundle = EnhancedEntityBundle::create(['id' => 'default', 'label' => 'Default']); $bundle->save(); }
/** * {@inheritdoc} */ protected function setUp() { parent::setUp(); EnhancedEntityBundle::create(['id' => 'default', 'label' => 'Default'])->save(); $this->placeBlock('local_tasks_block'); $this->placeBlock('system_breadcrumb_block'); $this->account = $this->drupalCreateUser(['administer entity_test_enhanced', 'view all entity_test_enhanced revisions']); $this->drupalLogin($this->account); }
/** * {@inheritdoc} */ protected function setUp() { parent::setUp(); $this->installEntitySchema('user'); $this->installEntitySchema('entity_test_enhanced'); $this->installSchema('system', 'router'); $bundle = EnhancedEntityBundle::create(['id' => 'default', 'label' => 'Default']); $bundle->save(); \Drupal::service('router.builder')->rebuild(); }
/** * Tests the add form. */ public function testAddForm() { $this->drupalGet('/entity_test_enhanced/add/first'); $assert = $this->assertSession(); $assert->elementTextContains('css', '.page-title', 'Add entity test with enhancements'); $assert->elementExists('css', 'form.entity-test-enhanced-first-add-form'); // In case of multiple bundles, the current one is a part of the page title. EnhancedEntityBundle::create(['id' => 'second', 'label' => 'Second', 'description' => 'The <b>second</b> bundle'])->save(); $this->drupalGet('/entity_test_enhanced/add/first'); $this->assertSession()->elementTextContains('css', '.page-title', 'Add First'); }
/** * {@inheritdoc} */ protected function setUp() { parent::setUp(); $this->installEntitySchema('user'); $this->installEntitySchema('entity_test_enhanced'); $this->installSchema('system', ['key_value_expire', 'sequences']); $bundle = EnhancedEntityBundle::create(['id' => 'default', 'label' => 'Default']); $bundle->save(); $this->user = User::create(['name' => 'username', 'status' => 1]); $this->user->save(); \Drupal::service('current_user')->setAccount($this->user); }