build(deps): remove discoverable_entity_bundle_classes

As this module is no longer supported, remove it from the codebase and
update all references to it within the custom code - instead manually
wrapping nodes with the `Post` or `Talk` class, or returning it from a
Repository.

Fixes: #465
This commit is contained in:
Oliver Davies 2021-12-17 15:16:52 +00:00
parent 41e13fe078
commit cae2091436
24 changed files with 214 additions and 150 deletions

View file

@ -16,9 +16,6 @@ final class PostTest extends EntityKernelTestBase {
'link',
'taxonomy',
// Contrib.
'discoverable_entity_bundle_classes',
// Custom.
'opdavies_blog',
'opdavies_blog_test',

View file

@ -18,7 +18,6 @@ abstract class PostTestBase extends EntityKernelTestBase {
'link',
// Contrib.
'discoverable_entity_bundle_classes',
'hook_event_dispatcher',
'core_event_dispatcher',

View file

@ -6,8 +6,9 @@ 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;
use Drupal\node\NodeInterface;
use Drupal\opdavies_blog\Entity\Node\Post;
final class PushToSocialMediaTest extends EntityKernelTestBase {
@ -20,7 +21,6 @@ final class PushToSocialMediaTest extends EntityKernelTestBase {
'link',
// Contrib.
'discoverable_entity_bundle_classes',
'hook_event_dispatcher',
'core_event_dispatcher',
@ -48,8 +48,8 @@ final class PushToSocialMediaTest extends EntityKernelTestBase {
$post = $item->data['post'];
$this->assertNotNull($post);
$this->assertInstanceOf(Post::class, $post);
$this->assertSame('1', $post->id());
$this->assertInstanceOf(NodeInterface::class, $post);
$this->assertSame('post', $post->bundle());
$this->assertSame('Ignoring PHPCS sniffs within PHPUnit tests', $post->getTitle());
}

View file

@ -5,6 +5,7 @@
namespace Drupal\Tests\opdavies_blog\Kernel;
use Drupal\node\Entity\Node;
use Drupal\node\NodeInterface;
use Drupal\opdavies_blog\Entity\Node\Post;
use Drupal\taxonomy\Entity\Vocabulary;
use Drupal\taxonomy\TermInterface;
@ -26,8 +27,8 @@ final class ReorderBlogTagsTest extends PostTestBase {
Post::FIELD_TAGS => [3, 1, 2],
]);
/** @var Post $post */
$post = Node::load($post->id());
$node = Node::load($post->id());
$post = Post::createFromNode($node);
$this->assertSame(
['Drupal', 'PHP', 'Symfony'],