Skip to content

Commit

Permalink
add customer/session to initLayoutMessages #92
Browse files Browse the repository at this point in the history
  • Loading branch information
GordonLesti committed Feb 8, 2015
1 parent ba91c11 commit 2410ade
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 11 deletions.
14 changes: 5 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
Lesti_Fpc
=========

## Build Status

* Master:
[![Build Status](https://travis-ci.org/GordonLesti/Lesti_Fpc.svg?branch=master)](https://travis-ci.org/GordonLesti/Lesti_Fpc)
[![Coverage Status](https://coveralls.io/repos/GordonLesti/Lesti_Fpc/badge.png?branch=master)](https://coveralls.io/r/GordonLesti/Lesti_Fpc?branch=master)
* Develop:
[![Build Status](https://travis-ci.org/GordonLesti/Lesti_Fpc.svg?branch=develop)](https://travis-ci.org/GordonLesti/Lesti_Fpc)
[![Coverage Status](https://coveralls.io/repos/GordonLesti/Lesti_Fpc/badge.png?branch=develop)](https://coveralls.io/r/GordonLesti/Lesti_Fpc?branch=develop)
Branch | Build Status | Coverage
--- | --- | ---
Master | [![Build Status](https://img.shields.io/travis/GordonLesti/Lesti_Fpc/master.svg?style=flat-square)](https://travis-ci.org/GordonLesti/Lesti_Fpc) | [![Coverage Status](https://img.shields.io/coveralls/GordonLesti/Lesti_Fpc/master.svg?style=flat-square)](https://coveralls.io/r/GordonLesti/Lesti_Fpc?branch=master)
Develop | [![Build Status](https://img.shields.io/travis/GordonLesti/Lesti_Fpc/develop.svg?style=flat-square)](https://travis-ci.org/GordonLesti/Lesti_Fpc) | [![Coverage Status](https://img.shields.io/coveralls/GordonLesti/Lesti_Fpc/develop.svg?style=flat-square)](https://coveralls.io/r/GordonLesti/Lesti_Fpc?branch=develop)

## Release Information

*Lesti_Fpc 1.3.6*
*Lesti_Fpc 1.3.7*

## System Requirements

Expand Down
2 changes: 1 addition & 1 deletion app/code/community/Lesti/Fpc/Helper/Block/Messages.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Lesti_Fpc_Helper_Block_Messages extends Mage_Core_Helper_Abstract
public function initLayoutMessages(
Mage_Core_Model_Layout $layout,
$messagesStorage =
array('catalog/session', 'tag/session', 'checkout/session')
array('catalog/session', 'tag/session', 'checkout/session', 'customer/session')
)
{
$block = $layout->getMessagesBlock();
Expand Down
21 changes: 21 additions & 0 deletions app/code/community/Lesti/Fpc/Test/Helper/Block/Messages.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,27 @@ public function testInitLayoutMessagesCheckout()
$this->assertCount(2, $messages);
}

/**
* @test
*/
public function testInitLayoutMessagesCustomer()
{
$layout = Mage::app()->getLayout();
/** @var Mage_Customer_Model_Session $customerStorage */
$customerStorage = Mage::getSingleton('customer/session');
$customerStorage->addSuccess('Fpc is cool.');
$customerStorage->addError('Fpc has no errors.');
$this->assertInstanceOf(
'Mage_Core_Model_Layout',
$this->_messagesHelper->initLayoutMessages($layout)
);

// test if session is now empty
$this->assertEquals(0, $customerStorage->getMessages()->count());
$messages = $layout->getMessagesBlock()->getMessages();
$this->assertCount(2, $messages);
}

/**
* @test
* @expectedException Mage_Core_exception
Expand Down
2 changes: 1 addition & 1 deletion app/code/community/Lesti/Fpc/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<config>
<modules>
<Lesti_Fpc>
<version>1.3.6</version>
<version>1.3.7</version>
</Lesti_Fpc>
</modules>
<global>
Expand Down

0 comments on commit 2410ade

Please sign in to comment.