All test method should have a void return type

This commit is contained in:
Oliver Davies 2020-12-17 23:14:49 +00:00
parent 8591a0f846
commit 280a381c68
4 changed files with 8 additions and 8 deletions

View file

@ -7,7 +7,7 @@ use Drupal\paragraphs\ParagraphInterface;
final class EventsAreReorderedByDateTest extends TalksTestBase { final class EventsAreReorderedByDateTest extends TalksTestBase {
public function testCreatingNode() { public function testCreatingNode(): void {
$events = [ $events = [
$this->createEvent([ $this->createEvent([
'field_date' => Carbon::today()->addWeeks(2), 'field_date' => Carbon::today()->addWeeks(2),
@ -50,7 +50,7 @@ final class EventsAreReorderedByDateTest extends TalksTestBase {
); );
} }
public function testUpdatingNode() { public function testUpdatingNode(): void {
$events = [ $events = [
$this->createEvent([ $this->createEvent([
'field_date' => Carbon::today()->addWeeks(2), 'field_date' => Carbon::today()->addWeeks(2),

View file

@ -17,7 +17,7 @@ final class TalkRepositoryTest extends TalksTestBase {
private TalkRepository $talkRepository; private TalkRepository $talkRepository;
/** @test */ /** @test */
public function get_all_talks() { public function get_all_talks(): void {
$this->createTalk(['title' => 'TDD - Test Driven Drupal']); $this->createTalk(['title' => 'TDD - Test Driven Drupal']);
$this->createTalk(['title' => 'Taking Flight with Tailwind CSS']); $this->createTalk(['title' => 'Taking Flight with Tailwind CSS']);
$this->createTalk(['title' => 'Upgrading to Drupal 9']); $this->createTalk(['title' => 'Upgrading to Drupal 9']);
@ -36,7 +36,7 @@ final class TalkRepositoryTest extends TalksTestBase {
} }
/** @test */ /** @test */
public function get_all_published_talks() { public function get_all_published_talks(): void {
$this->createTalk([ $this->createTalk([
'title' => 'TDD - Test Driven Drupal', 'title' => 'TDD - Test Driven Drupal',
'status' => NodeInterface::PUBLISHED, 'status' => NodeInterface::PUBLISHED,
@ -54,7 +54,7 @@ final class TalkRepositoryTest extends TalksTestBase {
} }
/** @test */ /** @test */
public function it_only_returns_talk_nodes() { public function it_only_returns_talk_nodes(): void {
$this->createNode(['type' => 'page']); $this->createNode(['type' => 'page']);
$talks = $this->talkRepository->getAll(); $talks = $this->talkRepository->getAll();

View file

@ -18,7 +18,7 @@ final class TalksPageSortTest extends TalksTestBase {
/** /**
* @test * @test
*/ */
public function upcoming_talks_are_shown_first_followed_by_past_talks_and_ordered_by_distance() { public function upcoming_talks_are_shown_first_followed_by_past_talks_and_ordered_by_distance(): void {
$this->createTalk([ $this->createTalk([
'field_event_date' => Carbon::today()->addDays(4)->getTimestamp(), 'field_event_date' => Carbon::today()->addDays(4)->getTimestamp(),
]); ]);

View file

@ -7,7 +7,7 @@ use Drupal\datetime\Plugin\Field\FieldType\DateTimeItemInterface;
final class UpdatesTalkCreatedDateTest extends TalksTestBase { final class UpdatesTalkCreatedDateTest extends TalksTestBase {
public function testCreatingNode() { public function testCreatingNode(): void {
$eventDate = Carbon::today()->addWeek(); $eventDate = Carbon::today()->addWeek();
$eventDateFormat = $eventDate $eventDateFormat = $eventDate
->format(DateTimeItemInterface::DATE_STORAGE_FORMAT); ->format(DateTimeItemInterface::DATE_STORAGE_FORMAT);
@ -22,7 +22,7 @@ final class UpdatesTalkCreatedDateTest extends TalksTestBase {
$this->assertEqual($eventDateTimestamp, $talk->getCreatedTime()); $this->assertEqual($eventDateTimestamp, $talk->getCreatedTime());
} }
public function testUpdatingNode() { public function testUpdatingNode(): void {
$talk = $this->createTalk(); $talk = $this->createTalk();
$originalCreatedTime = $talk->getCreatedTime(); $originalCreatedTime = $talk->getCreatedTime();