Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Commit

Permalink
Merge pull request zendframework/zendframework#4836 from manuscle/dev…
Browse files Browse the repository at this point in the history
…elop

Adding warning namespace
  • Loading branch information
weierophinney committed Jul 17, 2013
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Helper/FlashMessenger.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class FlashMessenger extends AbstractTranslatorHelper implements ServiceLocatorA
PluginFlashMessenger::NAMESPACE_ERROR => 'error',
PluginFlashMessenger::NAMESPACE_SUCCESS => 'success',
PluginFlashMessenger::NAMESPACE_DEFAULT => 'default',
PluginFlashMessenger::NAMESPACE_WARNING => 'warning',
);

/**
Expand Down
6 changes: 6 additions & 0 deletions test/Helper/FlashMessengerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public function seedMessages()
$helper->addMessage('bar');
$helper->addInfoMessage('bar-info');
$helper->addSuccessMessage('bar-success');
$helper->addWarningMessage('bar-warning');
$helper->addErrorMessage('bar-error');
unset($helper);
}
Expand Down Expand Up @@ -73,18 +74,21 @@ public function testCanRetrieveMessages()
$this->assertFalse($helper()->hasMessages());
$this->assertFalse($helper()->hasInfoMessages());
$this->assertFalse($helper()->hasSuccessMessages());
$this->assertFalse($helper()->hasWarningMessages());
$this->assertFalse($helper()->hasErrorMessages());

$this->seedMessages();

$this->assertTrue(count($helper('default')) > 0);
$this->assertTrue(count($helper('info')) > 0);
$this->assertTrue(count($helper('success')) > 0);
$this->assertTrue(count($helper('warning')) > 0);
$this->assertTrue(count($helper('error')) > 0);

$this->assertTrue($this->plugin->hasMessages());
$this->assertTrue($this->plugin->hasInfoMessages());
$this->assertTrue($this->plugin->hasSuccessMessages());
$this->assertTrue($this->plugin->hasWarningMessages());
$this->assertTrue($this->plugin->hasErrorMessages());
}

Expand All @@ -93,13 +97,15 @@ public function testCanProxyAndRetrieveMessagesFromPluginController()
$this->assertFalse($this->helper->hasMessages());
$this->assertFalse($this->helper->hasInfoMessages());
$this->assertFalse($this->helper->hasSuccessMessages());
$this->assertFalse($this->helper->hasWarningMessages());
$this->assertFalse($this->helper->hasErrorMessages());

$this->seedMessages();

$this->assertTrue($this->helper->hasMessages());
$this->assertTrue($this->helper->hasInfoMessages());
$this->assertTrue($this->helper->hasSuccessMessages());
$this->assertTrue($this->helper->hasWarningMessages());
$this->assertTrue($this->helper->hasErrorMessages());
}

Expand Down

0 comments on commit 4691db1

Please sign in to comment.