Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mlewis-everley committed Dec 20, 2017
1 parent 7679811 commit 9af0739
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions tests/SystemMessageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ public function testClosedByUser()
{
$member = $this->objFromFixture('Member', 'User1');
$message = $this->objFromFixture('SystemMessage', 'SecondMessage');
$this->assertNotFalse($message->isClosedByMember($member));
$this->assertNotFalse($message->isClosed($member));
$this->assertTrue($message->isClosedByMember($member));
$this->assertTrue($message->isClosed($member));
$this->assertFalse($message->isOpen($member));
}

Expand All @@ -28,7 +28,21 @@ public function testClosedByCookie()
$message = $this->objFromFixture('SystemMessage', 'FirstMessage');
Cookie::set("systemmessage.closed.{$message->ID}", true);

$this->assertNotFalse($message->isClosed());
$this->assertTrue($message->isClosed());
$this->assertFalse($message->isOpen());
}

/**
* Test to see if message is closed via cookie is flagged as "closed" or
* "open"
*/
public function testClosedBySession()
{
// Get message and set Cookie
$message = $this->objFromFixture('SystemMessage', 'FirstMessage');
Session::set("systemmessage.closed.{$message->ID}", true);

$this->assertTrue($message->isClosed());
$this->assertFalse($message->isOpen());
}

Expand Down

0 comments on commit 9af0739

Please sign in to comment.