parent
af25afe2cf
commit
ec6ac1d798
2 changed files with 20 additions and 12 deletions
|
@ -6,6 +6,7 @@ namespace Drupal\Tests\opdavies_blog\Kernel;
|
|||
|
||||
use Drupal\Core\Queue\QueueInterface;
|
||||
use Drupal\KernelTests\Core\Entity\EntityKernelTestBase;
|
||||
use Drupal\opdavies_blog\Entity\Node\Post;
|
||||
use Drupal\Tests\node\Traits\NodeCreationTrait;
|
||||
|
||||
final class PushToSocialMediaTest extends EntityKernelTestBase {
|
||||
|
@ -40,6 +41,15 @@ final class PushToSocialMediaTest extends EntityKernelTestBase {
|
|||
]);
|
||||
|
||||
$this->assertSame(1, $this->queue->numberOfItems());
|
||||
|
||||
$item = $this->queue->claimItem();
|
||||
/** @var Post $post */
|
||||
$post = $item->data['post'];
|
||||
|
||||
$this->assertNotNull($post);
|
||||
$this->assertInstanceOf(Post::class, $post);
|
||||
$this->assertSame('1', $post->id());
|
||||
$this->assertSame('Ignoring PHPCS sniffs within PHPUnit tests', $post->getTitle());
|
||||
}
|
||||
|
||||
protected function setUp() {
|
||||
|
@ -50,7 +60,7 @@ final class PushToSocialMediaTest extends EntityKernelTestBase {
|
|||
$this->installSchema('node', ['node_access']);
|
||||
|
||||
$this->queue = $this->container->get('queue')
|
||||
->get('push_post_to_social_media');
|
||||
->get('opdavies_blog_push_post_to_social_media');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue