Skip to content

Commit b8e348e

Browse files
committed
Support PSR-2 Naming convension for interfaces and abstract classes
1 parent cdfc200 commit b8e348e

117 files changed

Lines changed: 2704 additions & 2048 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

app/code/community/EcomDev/PHPUnit/Controller/Front.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ class EcomDev_PHPUnit_Controller_Front extends Mage_Core_Controller_Varien_Front
2626
* Resets initialized routers before front controller re-initialization
2727
* on test cases
2828
*
29-
* (non-PHPdoc)
3029
* @see Mage_Core_Controller_Varien_Front::init()
3130
*/
3231
public function init()

app/code/community/EcomDev/PHPUnit/Controller/Request/Http.php

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
*/
2727
class EcomDev_PHPUnit_Controller_Request_Http
2828
extends Mage_Core_Controller_Request_Http
29-
implements EcomDev_PHPUnit_Isolation_Interface,
30-
EcomDev_PHPUnit_Controller_Request_Interface
29+
implements EcomDev_PHPUnit_IsolationInterface,
30+
EcomDev_PHPUnit_Controller_RequestInterface
3131
{
3232
/**
3333
* List of $_SERVER variable changes
@@ -47,7 +47,6 @@ class EcomDev_PHPUnit_Controller_Request_Http
4747
/**
4848
* Initializes forward data
4949
*
50-
* (non-PHPdoc)
5150
* @see Mage_Core_Controller_Request_Http::initForward()
5251
*/
5352
public function initForward()
@@ -63,7 +62,7 @@ public function initForward()
6362

6463
/**
6564
* Returns only request uri that was set before
66-
* (non-PHPdoc)
65+
*
6766
* @see Zend_Controller_Request_Http::getRequestUri()
6867
*/
6968
public function getRequestUri()
@@ -119,7 +118,7 @@ public function resetQuery()
119118
}
120119

121120
/**
122-
* Resets $_POST superglobal for test request
121+
* Resets $_POST super global for test request
123122
*
124123
* @return EcomDev_PHPUnit_Controller_Request_Http
125124
*/
@@ -225,7 +224,6 @@ public function setHeaders(array $headers)
225224
/**
226225
* Returns header from test request parameters
227226
*
228-
* (non-PHPdoc)
229227
* @see Zend_Controller_Request_Http::getHeader()
230228
*/
231229
public function getHeader($header)
@@ -261,7 +259,7 @@ protected function headerName($name)
261259
}
262260

263261
/**
264-
* Sets value for a particular $_SERVER superglobal array key for test request
262+
* Sets value for a particular $_SERVER super global array key for test request
265263
*
266264
* Saves original value for returning it back
267265
*
@@ -281,7 +279,7 @@ public function setServer($name, $value)
281279
}
282280

283281
/**
284-
* Sets multiple values for $_SERVER superglobal in test request
282+
* Sets multiple values for $_SERVER super global in test request
285283
*
286284
* @param array $values
287285
* @return EcomDev_PHPUnit_Controller_Request_Http
@@ -295,7 +293,7 @@ public function setServers(array $values)
295293
}
296294

297295
/**
298-
* Resets $_SERVER superglobal to previous state
296+
* Resets $_SERVER super global to previous state
299297
*
300298
* @return EcomDev_PHPUnit_Controller_Request_Http
301299
*/
@@ -306,7 +304,7 @@ public function resetServer()
306304
$_SERVER[$name] = $value;
307305
} elseif (isset($_SERVER[$name])) {
308306
// If original value was not set,
309-
// then unsetting the changed value
307+
// then unset the changed value
310308
unset($_SERVER[$name]);
311309
}
312310
}
@@ -343,7 +341,6 @@ public function setIsSecure($flag = true)
343341
/**
344342
* Returns HTTP host from base url that were set in the controller
345343
*
346-
* (non-PHPdoc)
347344
* @see Mage_Core_Controller_Request_Http::getHttpHost()
348345
*/
349346
public function getHttpHost($trimPort = false)
@@ -373,7 +370,6 @@ public function getHttpHost($trimPort = false)
373370
/**
374371
* Returns only base url that was set before
375372
*
376-
* (non-PHPdoc)
377373
* @see Mage_Core_Controller_Request_Http::getBaseUrl()
378374
*/
379375
public function getBaseUrl()

app/code/community/EcomDev/PHPUnit/Controller/Response/Http.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
*/
2727
class EcomDev_PHPUnit_Controller_Response_Http
2828
extends Mage_Core_Controller_Response_Http
29-
implements EcomDev_PHPUnit_Isolation_Interface,
30-
EcomDev_PHPUnit_Controller_Response_Interface
29+
implements EcomDev_PHPUnit_IsolationInterface,
30+
EcomDev_PHPUnit_Controller_ResponseInterface
3131
{
3232
const LINE_ENDING = "\r\n";
3333

@@ -39,7 +39,7 @@ class EcomDev_PHPUnit_Controller_Response_Http
3939
protected $_sentHeaders = null;
4040

4141
/**
42-
* Response that was sent via sendRespose()
42+
* Response that was sent via sendResponse()
4343
* or sendHeaders() or outputBody() methods
4444
*
4545
* @var string
@@ -80,7 +80,6 @@ public function reset()
8080
/**
8181
* Implementation of sending the headers to output
8282
*
83-
* (non-PHPdoc)
8483
* @see Mage_Core_Controller_Response_Http::sendHeaders()
8584
*/
8685
public function sendHeaders()
@@ -156,7 +155,7 @@ public function getSentHeader($headerName)
156155

157156
/**
158157
* Implementation of sending response for test case
159-
* (non-PHPdoc)
158+
*
160159
* @see Mage_Core_Controller_Response_Http::sendResponse()
161160
*/
162161
public function sendResponse()
@@ -213,7 +212,7 @@ public function getOutputBody()
213212
/**
214213
* Can send headers implementation for test case
215214
*
216-
* (non-PHPdoc)
215+
*
217216
* @see Zend_Controller_Response_Abstract::canSendHeaders()
218217
*/
219218
public function canSendHeaders($throw = false)

app/code/community/EcomDev/PHPUnit/Model/App.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class EcomDev_PHPUnit_Model_App extends Mage_Core_Model_App
4343
const AREA_PART_TRANSLATE = EcomDev_PHPUnit_Model_App_Area::PART_TRANSLATE;
4444
const AREA_PART_CONFIG = EcomDev_PHPUnit_Model_App_Area::PART_CONFIG;
4545

46-
const INTERFACE_ISOLATION = 'EcomDev_PHPUnit_Isolation_Interface';
46+
const INTERFACE_ISOLATION = 'EcomDev_PHPUnit_IsolationInterface';
4747

4848
const REGISTRY_PATH_LAYOUT_SINGLETON = '_singleton/core/layout';
4949
const REGISTRY_PATH_DESIGN_PACKAGE_SINGLETON = '_singleton/core/design_package';
@@ -253,13 +253,14 @@ public function getCacheOptions()
253253
'_allowedCacheOptions'
254254
);
255255
}
256-
256+
257257
/**
258258
* Retrieves a model from config and checks it on interface implementation
259259
*
260260
* @param string $configPath
261261
* @param string $interface
262262
* @param string $modelName
263+
* @throws RuntimeException
263264
* @return Mage_Core_Model_Abstract
264265
*/
265266
protected function _getModelFromConfig($configPath, $interface, $modelName = 'Model')
@@ -330,6 +331,7 @@ public function resetAreas()
330331
*
331332
* @param string $key
332333
* @param string $value
334+
* @return $this
333335
*/
334336
public function replaceRegistry($key, $value)
335337
{
@@ -356,7 +358,7 @@ public function removeEventArea($code)
356358

357359
/**
358360
* Returns request for test suite
359-
* (non-PHPdoc)
361+
*
360362
* @see Mage_Core_Model_App::getRequest()
361363
* @return EcomDev_PHPUnit_Controller_Request_Http
362364
*/
@@ -374,7 +376,7 @@ public function getRequest()
374376

375377
/**
376378
* Returns response for test suite
377-
* (non-PHPdoc)
379+
*
378380
* @see Mage_Core_Model_App::getResponse()
379381
* @return EcomDev_PHPUnit_Controller_Response_Http
380382
*/
@@ -397,6 +399,7 @@ public function getResponse()
397399
*
398400
* @param string $configPath
399401
* @param string $interface
402+
* @throws RuntimeException
400403
* @return string
401404
*/
402405
protected function _getClassNameFromConfig($configPath, $interface = null)

app/code/community/EcomDev/PHPUnit/Model/App/Area.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
class EcomDev_PHPUnit_Model_App_Area
2626
extends Mage_Core_Model_App_Area
27-
implements EcomDev_PHPUnit_Isolation_Interface
27+
implements EcomDev_PHPUnit_IsolationInterface
2828
{
2929
const AREA_TEST = 'test';
3030
const AREA_ADMINHTML = 'adminhtml';

app/code/community/EcomDev/PHPUnit/Model/Config.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,8 @@ public function flushReplaceInstanceCreation()
118118
}
119119

120120
/**
121-
* Overriden for test case model instance creation mocking
121+
* Overridden for test case model instance creation mocking
122122
*
123-
* (non-PHPdoc)
124123
* @see Mage_Core_Model_Config::getModelInstance()
125124
*/
126125
public function getModelInstance($modelClass='', $constructArguments=array())
@@ -133,7 +132,7 @@ public function getModelInstance($modelClass='', $constructArguments=array())
133132
}
134133

135134
/**
136-
* Overriden for test case model instance creation mocking
135+
* Overridden for test case model instance creation mocking
137136
*
138137
* (non-PHPdoc)
139138
* @see Mage_Core_Model_Config::getModelInstance()
@@ -170,6 +169,7 @@ public function getRealResourceModelClassAlias($classAlias)
170169
/**
171170
* Loads scope snapshot
172171
*
172+
* @throws RuntimeException
173173
* @return EcomDev_PHPUnit_Model_Config
174174
*/
175175
public function loadScopeSnapshot()

app/code/community/EcomDev/PHPUnit/Model/Design/Package.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
class EcomDev_PHPUnit_Model_Design_Package
44
extends Mage_Core_Model_Design_Package
5-
implements EcomDev_PHPUnit_Design_Package_Interface,
6-
EcomDev_PHPUnit_Isolation_Interface
5+
implements EcomDev_PHPUnit_Design_PackageInterface,
6+
EcomDev_PHPUnit_IsolationInterface
77

88
{
99
/**
10-
* Asserts layout file existance in design packages,
11-
* and returns actual and expected filenames as result
10+
* Asserts layout file existence in design packages,
11+
* and returns actual and expected file names as result
1212
*
1313
* @param string $fileName
1414
* @param string $area

app/code/community/EcomDev/PHPUnit/Model/Expectation.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
class EcomDev_PHPUnit_Model_Expectation
4-
implements EcomDev_PHPUnit_Model_Expectation_Interface
4+
implements EcomDev_PHPUnit_Model_ExpectationInterface
55
{
66
/**
77
* List of created data object ids by path format
@@ -38,7 +38,7 @@ public function getDataObjectClassAlias()
3838
/**
3939
* Retrieves data object for a particular path format
4040
*
41-
* @see EcomDev_PHPUnit_Model_Expectation_Interface::getDataObject()
41+
* @see EcomDev_PHPUnit_Model_ExpectationInterface::getDataObject()
4242
*/
4343
public function getDataObject($pathFormat = null, $args = array())
4444
{
@@ -77,7 +77,7 @@ public function getDataObject($pathFormat = null, $args = array())
7777
/**
7878
* Applies loaded data
7979
*
80-
* @see EcomDev_PHPUnit_Model_Test_Loadable_Interface::apply()
80+
* @see EcomDev_PHPUnit_Model_Test_LoadableInterface::apply()
8181
*/
8282
public function apply()
8383
{
@@ -89,7 +89,7 @@ public function apply()
8989
* Removes objects created in object cache
9090
* Clears loaded data property
9191
*
92-
* @see EcomDev_PHPUnit_Model_Test_Loadable_Interface::discard()
92+
* @see EcomDev_PHPUnit_Model_Test_LoadableInterface::discard()
9393
*/
9494
public function discard()
9595
{
@@ -116,7 +116,7 @@ public function isLoaded()
116116
/**
117117
* Loads expected data from test case annotations
118118
*
119-
* @see EcomDev_PHPUnit_Model_Test_Loadable_Interface::loadByTestCase()
119+
* @see EcomDev_PHPUnit_Model_Test_LoadableInterface::loadByTestCase()
120120
*/
121121
public function loadByTestCase(PHPUnit_Framework_TestCase $testCase)
122122
{

app/code/community/EcomDev/PHPUnit/Model/Expectation/Interface.php

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,10 @@
1818
*/
1919

2020
/**
21-
* Interface for fixture model
22-
* Can be used for creation of
23-
* absolutely different implementation of fixture,
24-
* then current one.
21+
* @deprecated since 0.4.0
2522
*
2623
*/
27-
interface EcomDev_PHPUnit_Model_Expectation_Interface extends EcomDev_PHPUnit_Model_Test_Loadable_Interface
24+
interface EcomDev_PHPUnit_Model_Expectation_Interface
25+
extends EcomDev_PHPUnit_Model_ExpectationInterface
2826
{
29-
/**
30-
* Returns data object with expectations
31-
*
32-
* @param string $pathFormat
33-
* @param array $args arguments for format function
34-
* @return EcomDev_PHPUnit_Model_Expectation_Object
35-
*/
36-
public function getDataObject($pathFormat = null, $args = array());
37-
38-
/**
39-
* Check is expectation loaded
40-
*
41-
* @return boolean
42-
*/
43-
public function isLoaded();
4427
}

app/code/community/EcomDev/PHPUnit/Model/Expectation/Object.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,31 +59,31 @@ public function current()
5959
return $current;
6060
}
6161

62-
/* (non-PHPdoc)
62+
/**
6363
* @see Iterator::key()
6464
*/
6565
public function key()
6666
{
6767
return current($this->_iterationKeys);
6868
}
6969

70-
/* (non-PHPdoc)
70+
/**
7171
* @see Iterator::next()
7272
*/
7373
public function next()
7474
{
7575
next($this->_iterationKeys);
7676
}
7777

78-
/* (non-PHPdoc)
78+
/**
7979
* @see Iterator::rewind()
8080
*/
8181
public function rewind()
8282
{
8383
$this->_iterationKeys = $this->keys();
8484
}
8585

86-
/* (non-PHPdoc)
86+
/**
8787
* @see Iterator::valid()
8888
*/
8989
public function valid()

0 commit comments

Comments
 (0)