From 2410ade3b4641208e284ea9f4ce4c0e109e46719 Mon Sep 17 00:00:00 2001 From: Gordon Lesti Date: Sun, 8 Feb 2015 14:01:41 +0100 Subject: [PATCH] add customer/session to initLayoutMessages #92 --- README.md | 14 +++++-------- .../Lesti/Fpc/Helper/Block/Messages.php | 2 +- .../Lesti/Fpc/Test/Helper/Block/Messages.php | 21 +++++++++++++++++++ app/code/community/Lesti/Fpc/etc/config.xml | 2 +- 4 files changed, 28 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 0710851..fdc7130 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/app/code/community/Lesti/Fpc/Helper/Block/Messages.php b/app/code/community/Lesti/Fpc/Helper/Block/Messages.php index acfaae2..9ba3404 100644 --- a/app/code/community/Lesti/Fpc/Helper/Block/Messages.php +++ b/app/code/community/Lesti/Fpc/Helper/Block/Messages.php @@ -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(); diff --git a/app/code/community/Lesti/Fpc/Test/Helper/Block/Messages.php b/app/code/community/Lesti/Fpc/Test/Helper/Block/Messages.php index 3a0bdf6..8870f1b 100644 --- a/app/code/community/Lesti/Fpc/Test/Helper/Block/Messages.php +++ b/app/code/community/Lesti/Fpc/Test/Helper/Block/Messages.php @@ -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 diff --git a/app/code/community/Lesti/Fpc/etc/config.xml b/app/code/community/Lesti/Fpc/etc/config.xml index 6e13ed6..c03078c 100644 --- a/app/code/community/Lesti/Fpc/etc/config.xml +++ b/app/code/community/Lesti/Fpc/etc/config.xml @@ -15,7 +15,7 @@ - 1.3.6 + 1.3.7