Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
EcomDev_PHPUnit
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Open
EcomDev_PHPUnit
Commits
4417a0e5
Commit
4417a0e5
authored
Sep 13, 2011
by
Ivan Chepurnyi
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #9 from colinmollenhour/patch-6
Fix lots of minor bugs, vardocs and typos.
parents
9dec4527
777100eb
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
50 additions
and
29 deletions
+50
-29
app/code/community/EcomDev/PHPUnit/Model/App.php
app/code/community/EcomDev/PHPUnit/Model/App.php
+4
-4
app/code/community/EcomDev/PHPUnit/Model/Design/Package.php
app/code/community/EcomDev/PHPUnit/Model/Design/Package.php
+5
-0
app/code/community/EcomDev/PHPUnit/Model/Fixture.php
app/code/community/EcomDev/PHPUnit/Model/Fixture.php
+2
-5
app/code/community/EcomDev/PHPUnit/Model/Fixture/Interface.php
...ode/community/EcomDev/PHPUnit/Model/Fixture/Interface.php
+2
-2
app/code/community/EcomDev/PHPUnit/Model/Mysql4/Fixture/Eav/Abstract.php
...ity/EcomDev/PHPUnit/Model/Mysql4/Fixture/Eav/Abstract.php
+2
-2
app/code/community/EcomDev/PHPUnit/Model/Mysql4/Fixture/Eav/Catalog/Product.php
...mDev/PHPUnit/Model/Mysql4/Fixture/Eav/Catalog/Product.php
+3
-3
app/code/community/EcomDev/PHPUnit/Test/Case.php
app/code/community/EcomDev/PHPUnit/Test/Case.php
+2
-1
app/code/community/EcomDev/PHPUnit/Test/Case/Config.php
app/code/community/EcomDev/PHPUnit/Test/Case/Config.php
+29
-10
app/code/community/EcomDev/PHPUnit/Test/Case/Controller.php
app/code/community/EcomDev/PHPUnit/Test/Case/Controller.php
+1
-1
app/code/community/EcomDev/PHPUnit/Test/Suite/Group.php
app/code/community/EcomDev/PHPUnit/Test/Suite/Group.php
+0
-1
No files found.
app/code/community/EcomDev/PHPUnit/Model/App.php
View file @
4417a0e5
...
...
@@ -154,7 +154,7 @@ class EcomDev_PHPUnit_Model_App extends Mage_Core_Model_App
EcomDev_Utils_Reflection
::
setRestrictedPropertyValue
(
'Mage'
,
'_events'
,
new
self
::
$_eventCollectionClass
);
EcomDev_Utils_Reflection
::
setRestrictedPropertyValue
(
'Mage'
,
'_registry'
,
array
());
// All unit tests will be run
ned
in admin scope, to get rid of frontend restrictions
// All unit tests will be run in admin scope, to get rid of frontend restrictions
Mage
::
app
()
->
initTest
();
}
...
...
@@ -192,7 +192,7 @@ class EcomDev_PHPUnit_Model_App extends Mage_Core_Model_App
// Clean cache before the whole suite is running
$this
->
getCache
()
->
clean
();
// Init modules runs install proc
c
ess for table structures,
// Init modules runs install process for table structures,
// It is required for setting up proper setup script
$this
->
_initModules
();
...
...
@@ -366,7 +366,7 @@ class EcomDev_PHPUnit_Model_App extends Mage_Core_Model_App
/**
* Returns class name from configuration path,
* If $interface is specified, then it additionaly checks it for implementation
* If $interface is specified, then it additional
l
y checks it for implementation
*
*
* @param string $configPath
...
...
@@ -508,7 +508,7 @@ class EcomDev_PHPUnit_Model_App extends Mage_Core_Model_App
/**
* Overriden for disabling events
* fire during fix
ut
re loading
* fire during fix
tu
re loading
*
* (non-PHPdoc)
* @see Mage_Core_Model_App::dispatchEvent()
...
...
app/code/community/EcomDev/PHPUnit/Model/Design/Package.php
View file @
4417a0e5
...
...
@@ -30,6 +30,11 @@ class EcomDev_PHPUnit_Model_Design_Package
$this
->
setPackageName
(
$designPackage
);
$this
->
setTheme
(
$theme
);
$params
=
array
(
'_area'
=>
$area
,
'_package'
=>
$designPackage
,
'_theme'
=>
$theme
,
);
$actualFileName
=
$this
->
getLayoutFilename
(
$fileName
,
$params
);
if
(
$theme
!==
null
||
$designPackage
!==
null
)
{
...
...
app/code/community/EcomDev/PHPUnit/Model/Fixture.php
View file @
4417a0e5
...
...
@@ -308,7 +308,7 @@ class EcomDev_PHPUnit_Model_Fixture
/**
* Loads fixture files
*
* @param
string
$fixtures
* @param
array
$fixtures
* @param string|EcomDev_PHPUnit_Test_Case $classOrInstance
* @return EcomDev_PHPUnit_Model_Fixture
*/
...
...
@@ -631,7 +631,7 @@ class EcomDev_PHPUnit_Model_Fixture
/**
* Applies fixture EAV values
*
* @param array $
configuration
* @param array $
entities
* @return EcomDev_PHPUnit_Model_Fixture
*/
protected
function
_applyEav
(
$entities
)
...
...
@@ -761,7 +761,6 @@ class EcomDev_PHPUnit_Model_Fixture
* Validate scope data
*
* @param array $types
* @param array $modelByType
* @return EcomDev_PHPUnit_Model_Fixture
*/
protected
function
_validateScope
(
$types
)
...
...
@@ -772,8 +771,6 @@ class EcomDev_PHPUnit_Model_Fixture
}
foreach
(
$rows
as
$rowNumber
=>
$row
)
{
$scopeModel
=
Mage
::
getModel
(
$modelByType
[
$type
]);
if
(
!
isset
(
$row
[
$type
.
'_id'
]))
{
throw
new
RuntimeException
(
sprintf
(
'Missing primary key for "%s" scope entity at #%d row'
,
$type
,
$rowNumber
+
1
));
}
...
...
app/code/community/EcomDev/PHPUnit/Model/Fixture/Interface.php
View file @
4417a0e5
...
...
@@ -37,7 +37,7 @@ interface EcomDev_PHPUnit_Model_Fixture_Interface extends EcomDev_PHPUnit_Model_
public
function
setOptions
(
array
$options
);
/**
* Sets storage for fix
u
tures
* Sets storage for fixtures
*
* @param Varien_Object $storage
* @return EcomDev_PHPUnit_Model_Fixture_Interface
...
...
app/code/community/EcomDev/PHPUnit/Model/Mysql4/Fixture/Eav/Abstract.php
View file @
4417a0e5
...
...
@@ -148,7 +148,7 @@ abstract class EcomDev_PHPUnit_Model_Mysql4_Fixture_Eav_Abstract extends EcomDev
throw
new
RuntimeException
(
'Entity Id should be specified in EAV fixture'
);
}
// Ful
lfil nec
cessary information
// Ful
fill ne
cessary information
$row
[
'entity_type_id'
]
=
$entityTypeModel
->
getEntityTypeId
();
if
(
!
isset
(
$row
[
'attribute_set_id'
]))
{
$row
[
'attribute_set_id'
]
=
$entityTypeModel
->
getDefaultAttributeSetId
();
...
...
app/code/community/EcomDev/PHPUnit/Model/Mysql4/Fixture/Eav/Catalog/Product.php
View file @
4417a0e5
...
...
@@ -31,7 +31,7 @@ class EcomDev_PHPUnit_Model_Mysql4_Fixture_Eav_Catalog_Product extends EcomDev_P
/**
* Ov
veri
den to fix issue with flat tables existance mark
* Ov
errid
den to fix issue with flat tables existance mark
* (non-PHPdoc)
* @see EcomDev_PHPUnit_Model_Mysql4_Fixture_Eav_Abstract::loadEntity()
*/
...
...
@@ -48,7 +48,7 @@ class EcomDev_PHPUnit_Model_Mysql4_Fixture_Eav_Catalog_Product extends EcomDev_P
}
/**
* Overriden to add easy fixture loading for websites and categories associations
* Overrid
d
en to add easy fixture loading for websites and categories associations
* (non-PHPdoc)
* @see EcomDev_PHPUnit_Model_Mysql4_Fixture_Eav_Abstract::_getCustomTableRecords()
*/
...
...
app/code/community/EcomDev/PHPUnit/Test/Case.php
View file @
4417a0e5
...
...
@@ -691,6 +691,7 @@ abstract class EcomDev_PHPUnit_Test_Case extends PHPUnit_Framework_TestCase
*
* @param string $type
* @param string $configPath
* @return string
*/
protected
static
function
getLoadableClassAlias
(
$type
,
$configPath
)
{
...
...
app/code/community/EcomDev/PHPUnit/Test/Case/Config.php
View file @
4417a0e5
...
...
@@ -40,6 +40,7 @@ abstract class EcomDev_PHPUnit_Test_Case_Config extends EcomDev_PHPUnit_Test_Cas
* @param string $nodePath
* @param string $type
* @param mixed $expectedValue
* @return EcomDev_PHPUnit_Constraint_Config
*/
public
static
function
configNode
(
$nodePath
,
$type
,
$expectedValue
=
null
)
{
...
...
@@ -54,6 +55,7 @@ abstract class EcomDev_PHPUnit_Test_Case_Config extends EcomDev_PHPUnit_Test_Cas
* @param string $moduleName
* @param string $type
* @param string|null $expectedValue
* @return EcomDev_PHPUnit_Constraint_Config
*/
public
static
function
configModule
(
$moduleName
,
$type
,
$expectedValue
=
null
)
{
...
...
@@ -65,9 +67,11 @@ abstract class EcomDev_PHPUnit_Test_Case_Config extends EcomDev_PHPUnit_Test_Cas
/**
* A new constraint for checking module node
*
* @param string $moduleName
* @param string $group
* @param string $classAlias
* @param string $expectedClassName
* @param string $type
* @
param string|null $expectedValue
* @
return EcomDev_PHPUnit_Constraint_Config
*/
public
static
function
configClassAlias
(
$group
,
$classAlias
,
$expectedClassName
,
$type
=
EcomDev_PHPUnit_Constraint_Config_ClassAlias
::
TYPE_CLASS_ALIAS
)
...
...
@@ -86,6 +90,7 @@ abstract class EcomDev_PHPUnit_Test_Case_Config extends EcomDev_PHPUnit_Test_Cas
* @param string|null $layoutUpdate
* @param string|null $theme
* @param string|null $designPackage
* @return EcomDev_PHPUnit_Constraint_Config
*/
public
static
function
configLayout
(
$area
,
$expectedFile
,
$type
,
$layoutUpdate
=
null
,
$theme
=
null
,
$designPackage
=
null
)
{
...
...
@@ -106,7 +111,9 @@ abstract class EcomDev_PHPUnit_Test_Case_Config extends EcomDev_PHPUnit_Test_Cas
* @param string $eventName
* @param string $observerClassAlias
* @param string $observerMethod
* @param string $type
* @param string|null $observerName
* @return EcomDev_PHPUnit_Constraint_Config
*/
public
static
function
configEventObserver
(
$area
,
$eventName
,
$observerClassAlias
,
$observerMethod
,
$type
=
EcomDev_PHPUnit_Constraint_Config_EventObserver
::
TYPE_DEFINDED
,
$observerName
=
null
)
...
...
@@ -304,6 +311,7 @@ abstract class EcomDev_PHPUnit_Test_Case_Config extends EcomDev_PHPUnit_Test_Cas
*
* @param string $nodePath
* @param decimal $expectedValue
* @param string $message
*/
public
static
function
assertConfigNodeLessThanOrEquals
(
$nodePath
,
$expectedValue
,
$message
=
''
)
{
...
...
@@ -344,6 +352,7 @@ abstract class EcomDev_PHPUnit_Test_Case_Config extends EcomDev_PHPUnit_Test_Cas
*
* @param string $nodePath
* @param decimal $expectedValue
* @param string $message
*/
public
static
function
assertConfigNodeGreaterThanOrEquals
(
$nodePath
,
$expectedValue
,
$message
=
''
)
{
...
...
@@ -640,6 +649,7 @@ abstract class EcomDev_PHPUnit_Test_Case_Config extends EcomDev_PHPUnit_Test_Cas
* @param string $group
* @param string $classAlias
* @param string $expectedClassName
* @param string $message
*/
public
static
function
assertGroupedClassAlias
(
$group
,
$classAlias
,
$expectedClassName
,
$message
=
''
)
{
...
...
@@ -655,6 +665,7 @@ abstract class EcomDev_PHPUnit_Test_Case_Config extends EcomDev_PHPUnit_Test_Cas
* @param string $group
* @param string $classAlias
* @param string $expectedClassName
* @param string $message
*/
public
static
function
assertGroupedClassAliasNot
(
$group
,
$classAlias
,
$expectedClassName
,
$message
=
''
)
{
...
...
@@ -678,7 +689,8 @@ abstract class EcomDev_PHPUnit_Test_Case_Config extends EcomDev_PHPUnit_Test_Cas
self
::
assertGroupedClassAlias
(
EcomDev_PHPUnit_Constraint_Config_ClassAlias
::
GROUP_BLOCK
,
$classAlias
,
$expectedClassName
$expectedClassName
,
$message
);
}
...
...
@@ -694,7 +706,8 @@ abstract class EcomDev_PHPUnit_Test_Case_Config extends EcomDev_PHPUnit_Test_Cas
self
::
assertGroupedClassAliasNot
(
EcomDev_PHPUnit_Constraint_Config_ClassAlias
::
GROUP_BLOCK
,
$classAlias
,
$expectedClassName
$expectedClassName
,
$message
);
}
...
...
@@ -710,7 +723,8 @@ abstract class EcomDev_PHPUnit_Test_Case_Config extends EcomDev_PHPUnit_Test_Cas
self
::
assertGroupedClassAlias
(
EcomDev_PHPUnit_Constraint_Config_ClassAlias
::
GROUP_MODEL
,
$classAlias
,
$expectedClassName
$expectedClassName
,
$message
);
}
...
...
@@ -726,7 +740,8 @@ abstract class EcomDev_PHPUnit_Test_Case_Config extends EcomDev_PHPUnit_Test_Cas
self
::
assertGroupedClassAliasNot
(
EcomDev_PHPUnit_Constraint_Config_ClassAlias
::
GROUP_MODEL
,
$classAlias
,
$expectedClassName
$expectedClassName
,
$message
);
}
...
...
@@ -744,7 +759,8 @@ abstract class EcomDev_PHPUnit_Test_Case_Config extends EcomDev_PHPUnit_Test_Cas
self
::
assertGroupedClassAlias
(
EcomDev_PHPUnit_Constraint_Config_ClassAlias
::
GROUP_MODEL
,
$classAlias
,
$expectedClassName
$expectedClassName
,
$message
);
}
...
...
@@ -762,7 +778,8 @@ abstract class EcomDev_PHPUnit_Test_Case_Config extends EcomDev_PHPUnit_Test_Cas
self
::
assertGroupedClassAliasNot
(
EcomDev_PHPUnit_Constraint_Config_ClassAlias
::
GROUP_MODEL
,
$classAlias
,
$expectedClassName
$expectedClassName
,
$message
);
}
...
...
@@ -778,7 +795,8 @@ abstract class EcomDev_PHPUnit_Test_Case_Config extends EcomDev_PHPUnit_Test_Cas
self
::
assertGroupedClassAlias
(
EcomDev_PHPUnit_Constraint_Config_ClassAlias
::
GROUP_HELPER
,
$classAlias
,
$expectedClassName
$expectedClassName
,
$message
);
}
...
...
@@ -794,7 +812,8 @@ abstract class EcomDev_PHPUnit_Test_Case_Config extends EcomDev_PHPUnit_Test_Cas
self
::
assertGroupedClassAliasNot
(
EcomDev_PHPUnit_Constraint_Config_ClassAlias
::
GROUP_HELPER
,
$classAlias
,
$expectedClassName
$expectedClassName
,
$message
);
}
...
...
app/code/community/EcomDev/PHPUnit/Test/Case/Controller.php
View file @
4417a0e5
...
...
@@ -431,7 +431,7 @@ abstract class EcomDev_PHPUnit_Test_Case_Controller extends EcomDev_PHPUnit_Test
{
self
::
assertRequestNot
(
EcomDev_PHPUnit_Constraint_Controller_Request
::
TYPE_BEFORE_FORWARD_ROUTE
,
$expected
ActionNam
e
,
$message
$expected
BeforeForwardedRout
e
,
$message
);
}
...
...
app/code/community/EcomDev/PHPUnit/Test/Suite/Group.php
View file @
4417a0e5
...
...
@@ -38,7 +38,6 @@ class EcomDev_PHPUnit_Test_Suite_Group extends PHPUnit_Framework_TestSuite
*
* (non-PHPdoc)
* @see PHPUnit_Framework_TestSuite::__construct()
* @param array $groups
*/
public
function
__construct
(
$theClass
=
''
,
$groups
=
array
())
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment