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
be294b5a
Commit
be294b5a
authored
Feb 13, 2012
by
Ivan Chepurnyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
! Compatibility with PHPUnit 3.6.x
parent
f1d93b0c
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
43 additions
and
21 deletions
+43
-21
app/code/community/EcomDev/PHPUnit/Controller/Request/Http.php
...ode/community/EcomDev/PHPUnit/Controller/Request/Http.php
+1
-1
app/code/community/EcomDev/PHPUnit/Test/Case/Controller.php
app/code/community/EcomDev/PHPUnit/Test/Case/Controller.php
+27
-5
lib/EcomDev/PHPUnit/Constraint/Abstract.php
lib/EcomDev/PHPUnit/Constraint/Abstract.php
+5
-5
lib/EcomDev/PHPUnit/Constraint/Config/ClassAlias.php
lib/EcomDev/PHPUnit/Constraint/Config/ClassAlias.php
+1
-1
lib/EcomDev/PHPUnit/Constraint/Config/EventObserver.php
lib/EcomDev/PHPUnit/Constraint/Config/EventObserver.php
+1
-1
lib/EcomDev/PHPUnit/Constraint/Config/Layout.php
lib/EcomDev/PHPUnit/Constraint/Config/Layout.php
+1
-1
lib/EcomDev/PHPUnit/Constraint/Config/Node.php
lib/EcomDev/PHPUnit/Constraint/Config/Node.php
+1
-1
lib/EcomDev/PHPUnit/Constraint/Config/Resource.php
lib/EcomDev/PHPUnit/Constraint/Config/Resource.php
+1
-1
lib/EcomDev/PHPUnit/Constraint/Config/Resource/Script.php
lib/EcomDev/PHPUnit/Constraint/Config/Resource/Script.php
+1
-1
lib/EcomDev/PHPUnit/Constraint/Config/TableAlias.php
lib/EcomDev/PHPUnit/Constraint/Config/TableAlias.php
+1
-1
lib/EcomDev/PHPUnit/Constraint/Controller/Request.php
lib/EcomDev/PHPUnit/Constraint/Controller/Request.php
+1
-1
lib/EcomDev/PHPUnit/Constraint/Controller/Response/Abstract.php
...omDev/PHPUnit/Constraint/Controller/Response/Abstract.php
+1
-1
lib/EcomDev/PHPUnit/Constraint/Layout/Abstract.php
lib/EcomDev/PHPUnit/Constraint/Layout/Abstract.php
+1
-1
No files found.
app/code/community/EcomDev/PHPUnit/Controller/Request/Http.php
View file @
be294b5a
...
@@ -340,7 +340,7 @@ class EcomDev_PHPUnit_Controller_Request_Http
...
@@ -340,7 +340,7 @@ class EcomDev_PHPUnit_Controller_Request_Http
$parts
=
parse_url
(
$baseUrl
);
$parts
=
parse_url
(
$baseUrl
);
if
(
!
isset
(
$parts
[
'host'
]))
{
if
(
!
isset
(
$parts
[
'host'
]))
{
new
RuntimeException
(
'Cannot run controller test, because the host is not set for base url.'
);
throw
new
RuntimeException
(
'Cannot run controller test, because the host is not set for base url.'
);
}
}
$httpHost
=
$parts
[
'host'
];
$httpHost
=
$parts
[
'host'
];
...
...
app/code/community/EcomDev/PHPUnit/Test/Case/Controller.php
View file @
be294b5a
...
@@ -16,7 +16,6 @@
...
@@ -16,7 +16,6 @@
* @author Ivan Chepurnyi <ivan.chepurnyi@ecomdev.org>
* @author Ivan Chepurnyi <ivan.chepurnyi@ecomdev.org>
*/
*/
/**
/**
* Base for controller test case
* Base for controller test case
*
*
...
@@ -81,7 +80,7 @@ abstract class EcomDev_PHPUnit_Test_Case_Controller extends EcomDev_PHPUnit_Test
...
@@ -81,7 +80,7 @@ abstract class EcomDev_PHPUnit_Test_Case_Controller extends EcomDev_PHPUnit_Test
* @param string $type
* @param string $type
* @return EcomDev_PHPUnit_Constraint_Layout
* @return EcomDev_PHPUnit_Constraint_Layout
*/
*/
public
static
function
layout
(
$type
)
public
static
function
layout
(
$type
=
EcomDev_PHPUnit_Constraint_Layout
::
TYPE_LOADED
)
{
{
return
new
EcomDev_PHPUnit_Constraint_Layout
(
$type
);
return
new
EcomDev_PHPUnit_Constraint_Layout
(
$type
);
}
}
...
@@ -1902,20 +1901,29 @@ abstract class EcomDev_PHPUnit_Test_Case_Controller extends EcomDev_PHPUnit_Test
...
@@ -1902,20 +1901,29 @@ abstract class EcomDev_PHPUnit_Test_Case_Controller extends EcomDev_PHPUnit_Test
protected
function
reset
()
protected
function
reset
()
{
{
$_SESSION
=
array
();
$_SESSION
=
array
();
// Init request for any url that using sessions
$initialUrlParams
=
array
();
$urlModel
=
$this
->
getUrlModel
(
null
,
$initialUrlParams
);
$baseUrl
=
$urlModel
->
getBaseUrl
(
$initialUrlParams
);
$this
->
getRequest
()
->
reset
();
$this
->
getRequest
()
->
reset
();
$this
->
getRequest
()
->
setBaseUrl
(
$baseUrl
);
$this
->
getResponse
()
->
reset
();
$this
->
getResponse
()
->
reset
();
$this
->
getLayout
()
->
reset
();
$this
->
getLayout
()
->
reset
();
return
$this
;
return
$this
;
}
}
/**
/**
*
Dispatches controller action
*
Returns URL model for request
*
*
*
*
* @param string $route
* @param string
|null
$route
* @param array $params
* @param array $params
* @return Mage_Core_Model_Url
*/
*/
p
ublic
function
dispatch
(
$route
=
null
,
array
$params
=
array
()
)
p
rotected
function
getUrlModel
(
$route
=
null
,
array
&
$params
)
{
{
if
(
!
isset
(
$params
[
'_store'
]))
{
if
(
!
isset
(
$params
[
'_store'
]))
{
if
(
strpos
(
$route
,
EcomDev_PHPUnit_Model_App
::
AREA_ADMINHTML
)
!==
false
)
{
if
(
strpos
(
$route
,
EcomDev_PHPUnit_Model_App
::
AREA_ADMINHTML
)
!==
false
)
{
...
@@ -1932,6 +1940,20 @@ abstract class EcomDev_PHPUnit_Test_Case_Controller extends EcomDev_PHPUnit_Test
...
@@ -1932,6 +1940,20 @@ abstract class EcomDev_PHPUnit_Test_Case_Controller extends EcomDev_PHPUnit_Test
$urlModel
=
Mage
::
getModel
(
'adminhtml/url'
);
$urlModel
=
Mage
::
getModel
(
'adminhtml/url'
);
}
}
return
$urlModel
;
}
/**
* Dispatches controller action
*
*
* @param string $route
* @param array $params
*/
public
function
dispatch
(
$route
=
null
,
array
$params
=
array
())
{
$urlModel
=
$this
->
getUrlModel
(
$route
,
$params
);
$this
->
app
()
->
resetAreas
();
$this
->
app
()
->
resetAreas
();
$requestUri
=
$urlModel
->
getUrl
(
$route
,
$params
);
$requestUri
=
$urlModel
->
getUrl
(
$route
,
$params
);
...
...
lib/EcomDev/PHPUnit/Constraint/Abstract.php
View file @
be294b5a
...
@@ -181,9 +181,9 @@ abstract class EcomDev_PHPUnit_Constraint_Abstract
...
@@ -181,9 +181,9 @@ abstract class EcomDev_PHPUnit_Constraint_Abstract
* (non-PHPdoc)
* (non-PHPdoc)
* @see PHPUnit_Framework_Constraint::fail()
* @see PHPUnit_Framework_Constraint::fail()
*/
*/
public
function
fail
(
$other
,
$description
,
$not
=
FALSE
)
public
function
fail
(
$other
,
$description
,
PHPUnit_Framework_ComparisonFailure
$comparisonFailure
=
NULL
)
{
{
$failureDescription
=
sprintf
(
'Failed asserting that %s'
,
$this
->
failureDescription
(
$other
,
$description
,
$not
));
$failureDescription
=
sprintf
(
'Failed asserting that %s'
,
$this
->
failureDescription
(
$other
));
if
(
in_array
(
$this
->
_type
,
$this
->
_typesWithDiff
))
{
if
(
in_array
(
$this
->
_type
,
$this
->
_typesWithDiff
))
{
throw
new
EcomDev_PHPUnit_Constraint_Exception
(
throw
new
EcomDev_PHPUnit_Constraint_Exception
(
...
@@ -211,13 +211,13 @@ abstract class EcomDev_PHPUnit_Constraint_Abstract
...
@@ -211,13 +211,13 @@ abstract class EcomDev_PHPUnit_Constraint_Abstract
* @param boolean $not
* @param boolean $not
* @return string
* @return string
*/
*/
protected
function
failureDescription
(
$other
,
$description
,
$not
)
protected
function
failureDescription
(
$other
)
{
{
if
(
method_exists
(
$this
,
'customFailureDescription'
))
{
if
(
method_exists
(
$this
,
'customFailureDescription'
))
{
return
$this
->
customFailureDescription
(
$other
,
$description
,
$not
);
return
$this
->
customFailureDescription
(
$other
);
}
}
return
parent
::
failureDescription
(
$other
,
$description
,
$not
);
return
parent
::
failureDescription
(
$other
);
}
}
/**
/**
...
...
lib/EcomDev/PHPUnit/Constraint/Config/ClassAlias.php
View file @
be294b5a
...
@@ -128,7 +128,7 @@ class EcomDev_PHPUnit_Constraint_Config_ClassAlias
...
@@ -128,7 +128,7 @@ class EcomDev_PHPUnit_Constraint_Config_ClassAlias
* (non-PHPdoc)
* (non-PHPdoc)
* @see PHPUnit_Framework_Constraint::customFailureDescription()
* @see PHPUnit_Framework_Constraint::customFailureDescription()
*/
*/
protected
function
customFailureDescription
(
$other
,
$description
,
$not
)
protected
function
customFailureDescription
(
$other
)
{
{
return
sprintf
(
return
sprintf
(
'%s "%s/%s" %s.'
,
'%s "%s/%s" %s.'
,
...
...
lib/EcomDev/PHPUnit/Constraint/Config/EventObserver.php
View file @
be294b5a
...
@@ -166,7 +166,7 @@ class EcomDev_PHPUnit_Constraint_Config_EventObserver
...
@@ -166,7 +166,7 @@ class EcomDev_PHPUnit_Constraint_Config_EventObserver
* (non-PHPdoc)
* (non-PHPdoc)
* @see PHPUnit_Framework_Constraint::customFailureDescription()
* @see PHPUnit_Framework_Constraint::customFailureDescription()
*/
*/
protected
function
customFailureDescription
(
$other
,
$description
,
$not
)
protected
function
customFailureDescription
(
$other
)
{
{
return
sprintf
(
return
sprintf
(
'%s "%s" event observer %s.'
,
'%s "%s" event observer %s.'
,
...
...
lib/EcomDev/PHPUnit/Constraint/Config/Layout.php
View file @
be294b5a
...
@@ -182,7 +182,7 @@ class EcomDev_PHPUnit_Constraint_Config_Layout
...
@@ -182,7 +182,7 @@ class EcomDev_PHPUnit_Constraint_Config_Layout
* (non-PHPdoc)
* (non-PHPdoc)
* @see PHPUnit_Framework_Constraint::customFailureDescription()
* @see PHPUnit_Framework_Constraint::customFailureDescription()
*/
*/
protected
function
customFailureDescription
(
$other
,
$description
,
$not
)
protected
function
customFailureDescription
(
$other
)
{
{
return
sprintf
(
return
sprintf
(
'layout %s.'
,
'layout %s.'
,
...
...
lib/EcomDev/PHPUnit/Constraint/Config/Node.php
View file @
be294b5a
...
@@ -297,7 +297,7 @@ class EcomDev_PHPUnit_Constraint_Config_Node
...
@@ -297,7 +297,7 @@ class EcomDev_PHPUnit_Constraint_Config_Node
* (non-PHPdoc)
* (non-PHPdoc)
* @see PHPUnit_Framework_Constraint::customFailureDescription()
* @see PHPUnit_Framework_Constraint::customFailureDescription()
*/
*/
protected
function
customFailureDescription
(
$other
,
$description
,
$not
)
protected
function
customFailureDescription
(
$other
)
{
{
return
sprintf
(
return
sprintf
(
'configuration node "%s" %s.'
,
$this
->
_nodePath
,
$this
->
toString
()
'configuration node "%s" %s.'
,
$this
->
_nodePath
,
$this
->
toString
()
...
...
lib/EcomDev/PHPUnit/Constraint/Config/Resource.php
View file @
be294b5a
...
@@ -225,7 +225,7 @@ class EcomDev_PHPUnit_Constraint_Config_Resource
...
@@ -225,7 +225,7 @@ class EcomDev_PHPUnit_Constraint_Config_Resource
* (non-PHPdoc)
* (non-PHPdoc)
* @see PHPUnit_Framework_Constraint::customFailureDescription()
* @see PHPUnit_Framework_Constraint::customFailureDescription()
*/
*/
protected
function
customFailureDescription
(
$other
,
$description
,
$not
)
protected
function
customFailureDescription
(
$other
)
{
{
return
sprintf
(
return
sprintf
(
'setup resources %s.'
,
'setup resources %s.'
,
...
...
lib/EcomDev/PHPUnit/Constraint/Config/Resource/Script.php
View file @
be294b5a
...
@@ -355,7 +355,7 @@ class EcomDev_PHPUnit_Constraint_Config_Resource_Script
...
@@ -355,7 +355,7 @@ class EcomDev_PHPUnit_Constraint_Config_Resource_Script
* (non-PHPdoc)
* (non-PHPdoc)
* @see PHPUnit_Framework_Constraint::customFailureDescription()
* @see PHPUnit_Framework_Constraint::customFailureDescription()
*/
*/
protected
function
customFailureDescription
(
$other
,
$description
,
$not
)
protected
function
customFailureDescription
(
$other
)
{
{
return
sprintf
(
return
sprintf
(
'setup resources %s.'
,
'setup resources %s.'
,
...
...
lib/EcomDev/PHPUnit/Constraint/Config/TableAlias.php
View file @
be294b5a
...
@@ -94,7 +94,7 @@ class EcomDev_PHPUnit_Constraint_Config_TableAlias
...
@@ -94,7 +94,7 @@ class EcomDev_PHPUnit_Constraint_Config_TableAlias
* (non-PHPdoc)
* (non-PHPdoc)
* @see PHPUnit_Framework_Constraint::customFailureDescription()
* @see PHPUnit_Framework_Constraint::customFailureDescription()
*/
*/
protected
function
customFailureDescription
(
$other
,
$description
,
$not
)
protected
function
customFailureDescription
(
$other
)
{
{
return
sprintf
(
return
sprintf
(
'table alias "%s/%s" %s.'
,
'table alias "%s/%s" %s.'
,
...
...
lib/EcomDev/PHPUnit/Constraint/Controller/Request.php
View file @
be294b5a
...
@@ -298,7 +298,7 @@ class EcomDev_PHPUnit_Constraint_Controller_Request extends EcomDev_PHPUnit_Cons
...
@@ -298,7 +298,7 @@ class EcomDev_PHPUnit_Constraint_Controller_Request extends EcomDev_PHPUnit_Cons
* (non-PHPdoc)
* (non-PHPdoc)
* @see PHPUnit_Framework_Constraint::customFailureDescription()
* @see PHPUnit_Framework_Constraint::customFailureDescription()
*/
*/
protected
function
customFailureDescription
(
$other
,
$description
,
$not
)
protected
function
customFailureDescription
(
$other
)
{
{
return
sprintf
(
return
sprintf
(
'request %s.'
,
'request %s.'
,
...
...
lib/EcomDev/PHPUnit/Constraint/Controller/Response/Abstract.php
View file @
be294b5a
...
@@ -28,7 +28,7 @@ abstract class EcomDev_PHPUnit_Constraint_Controller_Response_Abstract
...
@@ -28,7 +28,7 @@ abstract class EcomDev_PHPUnit_Constraint_Controller_Response_Abstract
* (non-PHPdoc)
* (non-PHPdoc)
* @see PHPUnit_Framework_Constraint::customFailureDescription()
* @see PHPUnit_Framework_Constraint::customFailureDescription()
*/
*/
protected
function
customFailureDescription
(
$other
,
$description
,
$not
)
protected
function
customFailureDescription
(
$other
)
{
{
return
sprintf
(
return
sprintf
(
'request %s.'
,
'request %s.'
,
...
...
lib/EcomDev/PHPUnit/Constraint/Layout/Abstract.php
View file @
be294b5a
...
@@ -27,7 +27,7 @@ abstract class EcomDev_PHPUnit_Constraint_Layout_Abstract extends EcomDev_PHPUni
...
@@ -27,7 +27,7 @@ abstract class EcomDev_PHPUnit_Constraint_Layout_Abstract extends EcomDev_PHPUni
* (non-PHPdoc)
* (non-PHPdoc)
* @see PHPUnit_Framework_Constraint::customFailureDescription()
* @see PHPUnit_Framework_Constraint::customFailureDescription()
*/
*/
protected
function
customFailureDescription
(
$other
,
$description
,
$not
)
protected
function
customFailureDescription
(
$other
)
{
{
return
sprintf
(
return
sprintf
(
'layout %s.'
,
'layout %s.'
,
...
...
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