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:
parent
58f32fdaf4
commit
e0c59ee91a
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in a new issue