Skip to content

Commit

Permalink
init inbox service with its test
Browse files Browse the repository at this point in the history
  • Loading branch information
mgamal92 committed Feb 17, 2024
1 parent 61dd493 commit 1a5693c
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
41 changes: 41 additions & 0 deletions src/Services/Inbox.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

namespace MG\Inbox\Services;

class Inbox
{
public function send($message, $to)
{
return "Message sent to $to";
}

public function receive($message, $from)
{
return "Message received from $from";
}

public function markAsRead($message)
{
return "Message marked as read";
}

public function markAsUnread($message)
{
return "Message marked as unread";
}

public function delete($message)
{
return "Message deleted";
}

public function star($message)
{
return "Message starred";
}

public function unstar($message)
{
return "Message unstarred";
}
}
8 changes: 8 additions & 0 deletions tests/Services/InboxTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

it('can send a message', function () {
$inbox = new \MG\Inbox\Services\Inbox();
$result = $inbox->send('Hello', 'Taylor');
expect($result)->toBe('Message sent to Taylor');
});

0 comments on commit 1a5693c

Please sign in to comment.