5b: Check that it returns the post title

> Drupal\Tests\my_module\Unit\Entity\PostTest::it_returns_the_title
> Error: Call to undefined method Drupal\my_module\Entity\Post::getTitle()
This commit is contained in:
Oliver Davies 2020-11-14 09:57:54 +00:00
parent cbd0176c37
commit 07ad4dc2b1

View file

@ -2,8 +2,16 @@
namespace Drupal\Tests\my_module\Unit\Entity;
use Drupal\my_module\Entity\Post;
use Drupal\Tests\UnitTestCase;
class PostTest extends UnitTestCase {
/** @test */
public function it_returns_the_title() {
$post = new Post();
$this->assertSame('Test post', $post->getTitle());
}
}