Mercurial > hg > cmmr2012-drupal-site
diff vendor/chi-teck/drupal-code-generator/templates/d8/test/kernel.twig @ 4:a9cd425dd02b
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:11:55 +0000 |
parents | c75dbcec494b |
children |
line wrap: on
line diff
--- a/vendor/chi-teck/drupal-code-generator/templates/d8/test/kernel.twig Thu Feb 28 11:14:44 2019 +0000 +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/test/kernel.twig Thu Feb 28 13:11:55 2019 +0000 @@ -2,7 +2,6 @@ namespace Drupal\Tests\{{ machine_name }}\Kernel; -use Drupal\block\Entity\Block; use Drupal\KernelTests\KernelTestBase; /** @@ -15,43 +14,22 @@ /** * {@inheritdoc} */ - public static $modules = ['block', 'system', 'user']; + public static $modules = ['{{ machine_name }}']; /** * {@inheritdoc} */ protected function setUp() { parent::setUp(); - $this->container - ->get('entity_type.manager') - ->getStorage('block') - ->create([ - 'id' => 'test_block', - 'theme' => 'stark', - 'plugin' => 'system_powered_by_block', - ]) - ->save(); + // Mock required services here. } /** * Test callback. */ - public function testBlockRendering() { - $entity = Block::load('test_block'); - - $build = \Drupal::entityTypeManager() - ->getViewBuilder($entity->getEntityTypeId()) - ->view($entity); - - $content = $this - ->container - ->get('renderer') - ->renderRoot($build); - - $this->assertTrue( - strpos(strip_tags($content), 'Powered by Drupal') !== FALSE, - 'Valid block content was found.' - ); + public function testSomething() { + $result = $this->container->get('transliteration')->transliterate('Друпал'); + $this->assertEquals('Drupal', $result); } }