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
b937a839
Commit
b937a839
authored
Mar 04, 2014
by
Lee Saferite
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change to using an array for old scope data
parent
bfa5970e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
34 deletions
+15
-34
app/code/community/EcomDev/PHPUnit/Model/App.php
app/code/community/EcomDev/PHPUnit/Model/App.php
+15
-34
No files found.
app/code/community/EcomDev/PHPUnit/Model/App.php
View file @
b937a839
...
...
@@ -59,35 +59,16 @@ class EcomDev_PHPUnit_Model_App extends Mage_Core_Model_App
const
XML_PATH_CONTROLLER_RESPONSE
=
'phpunit/suite/controller/response/class'
;
/**
* Old configuration model to be returned back
* after unit tests are finished
*
* @var Mage_Core_Model_Config
*/
protected
static
$_oldConfig
=
null
;
/**
* Old application model to be returned back
* after unit tests are finished
*
* @var Mage_Core_Model_App
*/
protected
static
$_oldApplication
=
null
;
/**
* Old event collection to be returned back
* after the unit tests are finished
*
* @var Varien_Event_Collection
*/
protected
static
$_oldEventCollection
=
null
;
/**
* List of singletons in original application
* Old test scope data to be returned back after unit tests are finished
*
* @var array
*/
protected
static
$_oldRegistry
=
null
;
protected
static
$_oldTestScope
=
array
(
'app'
=>
null
,
'config'
=>
null
,
'events'
=>
null
,
'registry'
=>
null
,
);
/**
* Configuration model class name for unit tests
...
...
@@ -143,10 +124,10 @@ class EcomDev_PHPUnit_Model_App extends Mage_Core_Model_App
public
static
function
applyTestScope
()
{
// Save old environment variables
self
::
$_old
Application
=
EcomDev_Utils_Reflection
::
getRestrictedPropertyValue
(
'Mage'
,
'_app'
);
self
::
$_old
Config
=
EcomDev_Utils_Reflection
::
getRestrictedPropertyValue
(
'Mage'
,
'_config'
);
self
::
$_old
EventCollection
=
EcomDev_Utils_Reflection
::
getRestrictedPropertyValue
(
'Mage'
,
'_events'
);
self
::
$_old
Registry
=
EcomDev_Utils_Reflection
::
getRestrictedPropertyValue
(
'Mage'
,
'_registry'
);
self
::
$_old
TestScope
[
'app'
]
=
EcomDev_Utils_Reflection
::
getRestrictedPropertyValue
(
'Mage'
,
'_app'
);
self
::
$_old
TestScope
[
'config'
]
=
EcomDev_Utils_Reflection
::
getRestrictedPropertyValue
(
'Mage'
,
'_config'
);
self
::
$_old
TestScope
[
'events'
]
=
EcomDev_Utils_Reflection
::
getRestrictedPropertyValue
(
'Mage'
,
'_events'
);
self
::
$_old
TestScope
[
'registry'
]
=
EcomDev_Utils_Reflection
::
getRestrictedPropertyValue
(
'Mage'
,
'_registry'
);
// Setting environment variables for unit tests
...
...
@@ -435,10 +416,10 @@ class EcomDev_PHPUnit_Model_App extends Mage_Core_Model_App
public
static
function
discardTestScope
()
{
// Setting environment variables for unit tests
EcomDev_Utils_Reflection
::
setRestrictedPropertyValue
(
'Mage'
,
'_app'
,
self
::
$_old
Application
);
EcomDev_Utils_Reflection
::
setRestrictedPropertyValue
(
'Mage'
,
'_config'
,
self
::
$_old
Config
);
EcomDev_Utils_Reflection
::
setRestrictedPropertyValue
(
'Mage'
,
'_events'
,
self
::
$_old
EventCollection
);
EcomDev_Utils_Reflection
::
setRestrictedPropertyValue
(
'Mage'
,
'_registry'
,
self
::
$_old
Registry
);
EcomDev_Utils_Reflection
::
setRestrictedPropertyValue
(
'Mage'
,
'_app'
,
self
::
$_old
TestScope
[
'app'
]
);
EcomDev_Utils_Reflection
::
setRestrictedPropertyValue
(
'Mage'
,
'_config'
,
self
::
$_old
TestScope
[
'config'
]
);
EcomDev_Utils_Reflection
::
setRestrictedPropertyValue
(
'Mage'
,
'_events'
,
self
::
$_old
TestScope
[
'events'
]
);
EcomDev_Utils_Reflection
::
setRestrictedPropertyValue
(
'Mage'
,
'_registry'
,
self
::
$_old
TestScope
[
'registry'
]
);
}
/**
...
...
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