Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dwightwatson committed Feb 21, 2020
1 parent 0492e70 commit 4e1a263
Showing 1 changed file with 26 additions and 13 deletions.
39 changes: 26 additions & 13 deletions tests/ApnMessageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,111 +26,122 @@ public function it_can_set_title()
{
$message = new ApnMessage;

$message->title('Title');
$result = $message->title('Title');

$this->assertEquals('Title', $message->title);
$this->assertEquals($message, $result);
}

/** @test */
public function it_can_set_body()
{
$message = new ApnMessage;

$message->body('Body');
$result = $message->body('Body');

$this->assertEquals('Body', $message->body);
$this->assertEquals($message, $result);
}

/** @test */
public function it_can_set_badge()
{
$message = new ApnMessage;

$message->badge(1);
$result = $message->badge(1);

$this->assertEquals(1, $message->badge);
$this->assertEquals($message, $result);
}

/** @test */
public function it_can_set_sound()
{
$message = new ApnMessage;

$message->sound('Laravel Podcast');
$result = $message->sound('Laravel Podcast');

$this->assertEquals('Laravel Podcast', $message->sound);
$this->assertEquals($message, $result);
}

/** @test */
public function it_can_set_sound_to_default()
{
$message = new ApnMessage;

$message->sound();
$result = $message->sound();

$this->assertEquals('default', $message->sound);
$this->assertEquals($message, $result);
}

/** @test */
public function it_can_set_category()
{
$message = new ApnMessage;

$message->category('Category');
$result = $message->category('Category');

$this->assertEquals('Category', $message->category);
$this->assertEquals($message, $result);
}

/** @test */
public function it_can_set_content_available()
{
$message = new ApnMessage;

$message->contentAvailable(1);
$result = $message->contentAvailable(1);

$this->assertEquals(1, $message->contentAvailable);
$this->assertEquals($message, $result);
}

/** @test */
public function it_can_set_push_type()
{
$message = new ApnMessage;

$message->pushType('type');
$result = $message->pushType('type');

$this->assertEquals('type', $message->pushType);
$this->assertEquals($message, $result);
}

/** @test */
public function it_can_set_custom_value()
{
$message = new ApnMessage;

$message->custom('foo', 'bar');
$result = $message->custom('foo', 'bar');

$this->assertEquals(['foo' => 'bar'], $message->custom);
$this->assertEquals($message, $result);
}

/** @test */
public function it_can_set_custom_values()
{
$message = new ApnMessage;

$message->setCustom(['foo' => 'bar']);
$result = $message->setCustom(['foo' => 'bar']);

$this->assertEquals(['foo' => 'bar'], $message->custom);
$this->assertEquals($message, $result);
}

/** @test */
public function it_can_set_action()
{
$message = new ApnMessage;

$message->action('action', ['foo' => 'bar']);
$result = $message->action('action', ['foo' => 'bar']);

$expected = ['action' => ['action' => 'action', 'params' => ['foo' => 'bar']]];

$this->assertEquals($expected, $message->custom);
$this->assertEquals($message, $result);
}

/** @test */
Expand All @@ -140,18 +151,20 @@ public function it_can_set_client()

$client = Mockery::mock(Client::class);

$message->via($client);
$result = $message->via($client);

$this->assertEquals($client, $message->client);
$this->assertEquals($message, $result);
}

/** @test */
public function it_can_set_mutable_content()
{
$message = new ApnMessage;

$message->mutableContent(1);
$result = $message->mutableContent(1);

$this->assertEquals(1, $message->mutableContent);
$this->assertEquals($message, $result);
}
}

0 comments on commit 4e1a263

Please sign in to comment.