Skip to content

Commit

Permalink
add status tracking property
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul M. Jones committed May 1, 2015
1 parent e81dfb6 commit 616a352
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
18 changes: 18 additions & 0 deletions src/PayloadInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,24 @@
*/
interface PayloadInterface
{
/**
*
* Sets the status of this payload.
*
* @param mixed $status The status for this payload.
*
*/
public function setStatus($status);

/**
*
* Sets the status of this payload.
*
* @return mixed
*
*/
public function getStatus();

/**
*
* Sets the input received by the domain layer.
Expand Down
12 changes: 12 additions & 0 deletions tests/Payload.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,24 @@

class Payload implements PayloadInterface
{
protected $status;
protected $input;
protected $output;
protected $code;
protected $message;
protected $extras;

public function setStatus($status)
{
$this->status = $status;
return $this;
}

public function getStatus()
{
return $this->status;
}

public function setInput($input)
{
$this->input = $input;
Expand Down
4 changes: 3 additions & 1 deletion tests/PayloadTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ public function test()
{
$payload = new Payload();

$payload->setInput('input')
$payload->setStatus('status')
->setInput('input')
->setOutput('output')
->setCode('code')
->setMessage('message')
->setExtras('extras');

$this->assertSame('status', $payload->getStatus());
$this->assertSame('input', $payload->getInput());
$this->assertSame('output', $payload->getOutput());
$this->assertSame('code', $payload->getCode());
Expand Down

0 comments on commit 616a352

Please sign in to comment.