Add a failing unit test

> Drupal\Core\DependencyInjection\ContainerNotInitializedException: \Drupal::$container is not initialized yet. \Drupal::setContainer() must be called with a real container.
This commit is contained in:
Oliver Davies 2024-01-20 09:09:13 +00:00
parent 58f32fdaf4
commit e0c59ee91a

View file

@ -0,0 +1,24 @@
<?php
namespace Drupal\Tests\example\Unit;
use Drupal\node\Entity\Node;
use Drupal\node\NodeInterface;
use Drupal\Tests\UnitTestCase;
/**
* @group lessons
*/
final class PostWrapperTest extends UnitTestCase {
/** @test */
public function it_wraps_a_post(): void {
$node = new Node(
entity_type: 'post',
values: [],
);
self::assertInstanceOf(NodeInterface::class, $node);
}
}