Add lesson 9
This commit is contained in:
parent
2daeca7f8e
commit
01289d8711
|
@ -3,6 +3,7 @@
|
||||||
namespace Drupal\Tests\example\Unit;
|
namespace Drupal\Tests\example\Unit;
|
||||||
|
|
||||||
use Drupal\example\PostWrapper;
|
use Drupal\example\PostWrapper;
|
||||||
|
use Drupal\node\Entity\Node;
|
||||||
use Drupal\node\NodeInterface;
|
use Drupal\node\NodeInterface;
|
||||||
use Drupal\Tests\UnitTestCase;
|
use Drupal\Tests\UnitTestCase;
|
||||||
|
|
||||||
|
@ -13,7 +14,7 @@ final class PostWrapperTest extends UnitTestCase {
|
||||||
|
|
||||||
/** @test */
|
/** @test */
|
||||||
public function it_wraps_a_post(): void {
|
public function it_wraps_a_post(): void {
|
||||||
$node = $this->createMock(NodeInterface::class);
|
$node = Node::create(['type' => 'post']);
|
||||||
$node->method('bundle')->willReturn('post');
|
$node->method('bundle')->willReturn('post');
|
||||||
|
|
||||||
$wrapper = new PostWrapper($node);
|
$wrapper = new PostWrapper($node);
|
||||||
|
|
Loading…
Reference in a new issue