Skip to content

Commit

Permalink
Remove clearAttachments method from RocketChatMessage class (#10)
Browse files Browse the repository at this point in the history
Remove clearAttachments method from RocketChatMessage class
  • Loading branch information
antonkomarev committed Feb 24, 2020
1 parent 27da688 commit 0556a13
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 26 deletions.
12 changes: 0 additions & 12 deletions src/RocketChatMessage.php
Expand Up @@ -169,18 +169,6 @@ public function attachments(array $attachments): self
return $this;
}

/**
* Clear all attachments.
*
* @return $this
*/
public function clearAttachments(): self
{
$this->attachments = [];

return $this;
}

/**
* Get an array representation of the RocketChatMessage.
*
Expand Down
14 changes: 0 additions & 14 deletions tests/RocketChatMessageTest.php
Expand Up @@ -102,18 +102,4 @@ public function it_can_set_multiple_attachments(): void

$this->assertCount(3, $message->toArray()['attachments']);
}

/** @test */
public function it_can_clear_attachments(): void
{
$message = (new RocketChatMessage())->attachments([
RocketChatAttachment::make(),
RocketChatAttachment::make(),
RocketChatAttachment::make(),
]);

$message->clearAttachments();

$this->assertArrayNotHasKey('attachments', $message->toArray());
}
}

0 comments on commit 0556a13

Please sign in to comment.