Add the action to PostTest
This commit is contained in:
parent
25780e084b
commit
23cc7cec2d
11
web/modules/custom/blog/src/Action/ConvertPostToTweet.php
Normal file
11
web/modules/custom/blog/src/Action/ConvertPostToTweet.php
Normal file
|
@ -0,0 +1,11 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Drupal\opdavies_blog\Action;
|
||||
|
||||
use Drupal\opdavies_blog\Entity\Node\Post;
|
||||
|
||||
final class ConvertPostToTweet {
|
||||
|
||||
}
|
|
@ -5,6 +5,7 @@
|
|||
namespace Drupal\Tests\opdavies_blog\Kernel\Entity\Node;
|
||||
|
||||
use Drupal\KernelTests\Core\Entity\EntityKernelTestBase;
|
||||
use Drupal\opdavies_blog\Action\ConvertPostToTweet;
|
||||
use Drupal\opdavies_blog\Entity\Node\Post;
|
||||
use Drupal\opdavies_blog_test\Factory\PostFactory;
|
||||
|
||||
|
@ -26,6 +27,8 @@ final class PostTest extends EntityKernelTestBase {
|
|||
|
||||
private PostFactory $postFactory;
|
||||
|
||||
private ConvertPostToTweet $convertPostToTweet;
|
||||
|
||||
/** @test */
|
||||
public function it_can_determine_if_a_post_contains_a_tweet(): void {
|
||||
$post = $this->postFactory->create();
|
||||
|
@ -83,6 +86,7 @@ final class PostTest extends EntityKernelTestBase {
|
|||
parent::setUp();
|
||||
|
||||
$this->postFactory = $this->container->get(PostFactory::class);
|
||||
$this->convertPostToTweet = $this->container->get(ConvertPostToTweet::class);
|
||||
|
||||
$this->installEntitySchema('taxonomy_term');
|
||||
|
||||
|
|
Loading…
Reference in a new issue