1 | <?php |
||
16 | abstract class Zookal_Mock_Model_Mocks_Abstract |
||
|
|||
17 | { |
||
18 | |||
19 | /** |
||
20 | * @var Zookal_Mock_Helper_Data |
||
21 | */ |
||
22 | protected $_helper = null; |
||
23 | |||
24 | protected $_isLogEnabled = false; |
||
25 | |||
26 | protected $_mockMethodsReturnThis = array( |
||
27 | 'add' => 1, // e.g. addCustomerFilter ... |
||
28 | 'cle' => 1, // e.g. clean() clear() clearasil() |
||
29 | 'collectrates' => 1, // e.g. Mage_Shipping_Model_Shipping::collectRates() |
||
30 | 'fil' => 1, // e.g. filterByCustomerId() when getCollection() is called |
||
31 | 'gettotals' => 1, // Special case in Sales_Collection |
||
32 | 'gro' => 1, // e.g. groupByCustomer |
||
33 | 'joi' => 1, // e.g. joinCustomerName |
||
34 | 'loa' => 1, // e.g. load and loadBy.... |
||
35 | 'lim' => 1, // e.g. limit() -> on collection |
||
36 | 'ord' => 1, // e.g. orderByTotalAmount |
||
37 | 'pre' => 1, // e.g. prepare() |
||
38 | 'resetsortorder' => 1, |
||
39 | 'renewsession' => 1, |
||
40 | 'sav' => 1, // e.g. save() |
||
41 | 'set' => 1, |
||
42 | 'too' => 1, // e.g. toOptionArray, toOptionHash |
||
43 | 'uns' => 1, |
||
44 | 'pro' => 1, // Weee Helper->processTierPrices() |
||
45 | ); |
||
46 | protected $_mockMethodsReturnNull = array( |
||
47 | 'count' => 1, |
||
48 | 'get' => 1, |
||
49 | 'toh' => 1, // toHtml() on blocks |
||
50 | ); |
||
51 | protected $_mockMethodsReturnFalse = array( |
||
52 | 'displaygirthvalue' => 1, // Mage_Usa helper in packaging/popup.phtml |
||
53 | 'can' => 1, // canCapture and all other payment related methods |
||
54 | 'has' => 1, |
||
55 | 'isa' => 1, // e.g. isAvailable -> Payment |
||
56 | 'isd' => 1, // e.g. isDiscounted e.g. Weee helper |
||
57 | 'ise' => 1, // e.g. isEnabled e.g. Weee helper |
||
58 | 'isg' => 1, // e.g. isGateway -> Payment |
||
59 | 'isi' => 1, // e.g. isInitializeNeeded -> Payment |
||
60 | 'ism' => 1, // e.g. isMessagesAvailable -> GiftMessage |
||
61 | 'iss' => 1, // e.g. isSubscribed |
||
62 | 'ist' => 1, // e.g. isTaxable in Weee |
||
63 | 'isv' => 1, // e.g. isValid... |
||
64 | 'isl' => 1, // e.g. isLoggedIn |
||
65 | 'use' => 1, |
||
66 | 'typ' => 1, // Weee Helper->typeofdisplay() |
||
67 | 'val' => 1, // Weee Helper->validateCatalogPricesAndFptConfiguration() |
||
68 | 'inc' => 1, // Weee Helper->includeInSubtotal() |
||
69 | ); |
||
70 | |||
71 | /** |
||
72 | * @param Zookal_Mock_Helper_Data $helper |
||
73 | */ |
||
74 | public function __construct($helper = null) |
||
83 | |||
84 | /** |
||
85 | * Add/Set/Get attribute wrapper |
||
86 | * |
||
87 | * @param string $method |
||
88 | * @param array $args |
||
89 | * |
||
90 | * @return $this|bool|null |
||
91 | * @throws Varien_Exception |
||
92 | */ |
||
93 | public function __call($method, $args) |
||
110 | |||
111 | /** |
||
112 | * @param string $lowerMethod |
||
113 | * @param string $firstThree |
||
114 | * |
||
115 | * @return bool |
||
116 | */ |
||
117 | protected function _isReturnFalse($lowerMethod, $firstThree) |
||
122 | |||
123 | /** |
||
124 | * @param string $lowerMethod |
||
125 | * @param string $firstThree |
||
126 | * |
||
127 | * @return bool |
||
128 | */ |
||
129 | protected function _isReturnNull($lowerMethod, $firstThree) |
||
134 | |||
135 | /** |
||
136 | * @param string $lowerMethod |
||
137 | * @param string $firstThree |
||
138 | * |
||
139 | * @return bool |
||
140 | */ |
||
141 | protected function _isReturnThis($lowerMethod, $firstThree) |
||
148 | |||
149 | /** |
||
150 | * Special case if Mage_Tag is disabled or any other module which rely on initLayoutMessages |
||
151 | * |
||
152 | * @return Mage_Core_Model_Message_Collection |
||
153 | */ |
||
154 | public function getMessages() |
||
158 | |||
159 | /** |
||
160 | * uncomment this in dev env to see what methods are called |
||
161 | * |
||
162 | * @param string $msg |
||
163 | */ |
||
164 | protected function _log($msg) |
||
170 | |||
171 | /** |
||
172 | * @return Zookal_Mock_Helper_Data |
||
173 | */ |
||
174 | public function getHelper() |
||
181 | |||
182 | /** |
||
183 | * @return array |
||
184 | */ |
||
185 | public function getMockMethodsReturnFalse() |
||
189 | |||
190 | /** |
||
191 | * @return array |
||
192 | */ |
||
193 | public function getMockMethodsReturnNull() |
||
197 | |||
198 | /** |
||
199 | * @return array |
||
200 | */ |
||
201 | public function getMockMethodsReturnThis() |
||
205 | } |
||
206 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.