elcodi/elcodi — pull request #96 by mmoreram (2014-06-13 11:38:08+00:00)
Title: CartBundle Refactoring and Money

Issue #16 #22 #94 #18

* Added more useful functional and unit tests
* Refactored managers, and uncoupling them a little bit more
* Uncoupled as much as possble all managers with ObjectManager
* Updated entity relation mapping definitions
* Added orphanRemovals
* Added properly all cascade definitions
* Added by default buildSchema in WebTestCase
* Fixed CartCoupon to work properly with these changes
* Added some minor tests in CartCouponBundle
* Passed php-cs-fixer

Money entity creation

Fixtures were also adapted so that they can work with Money.
A Coupon now needs a Currency in order to specify an amount representing
a price. ElcodiCouponTypes::TYPE_AMOUNT|TYPE_PERCENT discriminates between
a fixed amount or a percent discount to be applied

Cart::amount, Cart::productAmount and Cart::couponAmount are
now unmapped properties. Their values are calculated dinamically by the
Cart event listeners. Consequently, there is no need for a mapped Currency
in the Cart entity.

Coupon amounts property and accessor methods where removed from PriceTrait,
since they are not used in AbstractLine

This is a rebase for these commits

b7aebb4 WIP: Fixed listener priority to set cart.ordered=1
271b778 WIP: Fixed incorrect @cover method annotation
a543c52 WIP: Small style refactoring
c1bdf75 WIP: NullMoney should return false for comparison methods
f69fa17 Updated database file folder
cf96226 wip
07ee325 WIP
9f17755 WIP
eb81bae WIP: changed assert method to exploit Money multiply()
23fedf9 WIP: Added NullMoney null object. Changed Money factory
2959e61 WIP: calulate Cart grand totals only in CartLines exist
3c1a5d8 WIP: fixed incorrect method name in CartCouponBundle event listeners config
376c53e WIP
e0692f8 WIP: Coupon::discount now defaults to 0
084da66 WIP: Fixed price assignment to a Coupon in fixtures
da46932 WIP: Removed unuseful Cart from CartCoupon fixtures
00fa5f7 WIP: Removed setCouponAmount() call to a AbstractLine object
80683bb WIP: added CurrencyBundle to the necessary fixtures for test
f489ea0 WIP: fixed Cart fixture not setting amount
e552ddb WIP: fixed test setUp not setting currencies in cartline
91a8903 Merge branch 'a' into money-fixes-for-coupon-and-fixtures
fed2afb Some changes
3a694cf WIP
cabe017 WIP: removed couponAmount from PriceTrait
deda77f WIP
3e88aac WIP: missing class parameter for PrintMoneyExtension
6557db4 More code coverage friendly phpunit.xml config
e1b2694 Removed unused file
4ed16dd Fixed coupon class
361a362 Money WIP
862c563 Cart amounts are now calculated dynamically
aed4987 Added missing Money support in Coupon and CartCoupon
db83c4a Refactored CartBundle