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
2106b5e2
Commit
2106b5e2
authored
Jun 01, 2013
by
Ivan Chepurnyi
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #109 from oleg-kravets/dev
Fix issue #108
parents
44f309be
9bdcaea0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
0 deletions
+32
-0
shell/ecomdev-phpunit.php
shell/ecomdev-phpunit.php
+32
-0
No files found.
shell/ecomdev-phpunit.php
View file @
2106b5e2
...
...
@@ -27,6 +27,7 @@ class EcomDev_PHPUnit_Install extends Mage_Shell_Abstract
{
const
FILE_LOCAL_XML
=
'app/etc/local.xml.phpunit'
;
const
FILE_PHPUNIT_XML
=
'phpunit.xml.dist'
;
const
FILE_CONFIG_XML
=
'app/code/community/EcomDev/PHPUnit/etc/config.xml'
;
const
OLD_FILE_MATCH
=
'/\\<file\\>UnitTests.php\\<\\/file\\>/'
;
...
...
@@ -111,6 +112,8 @@ Defined actions:
--url-rewrite <bool> Changes use of url rewrites for unit tests
--base_url <string> Changes base url for controller tests
show-version Shows current version of the module
change-status Changes status of EcomDev_PHPUnitTest module, that contains built in supplied tests
--enable Used to determine the status of it. If not specified, it will be disabled
...
...
@@ -161,6 +164,11 @@ USAGE;
case
'fix-autoloader'
:
$this
->
_fixAutoloader
();
break
;
case
'show-version'
:
$version
=
$this
->
_retrieveVersion
();
$this
->
_cleanCache
();
echo
"EcomDev_PHPUnit module version is
{
$version
}
\n
"
;
break
;
default
:
$this
->
_showHelp
();
break
;
...
...
@@ -325,6 +333,30 @@ USAGE;
echo
"Varien_Autoloader was patched
\n
"
;
}
/**
* Retrieve current module version from the config.xml file
*
* @return string
*/
protected
function
_retrieveVersion
()
{
if
(
!
file_exists
(
$this
->
getArg
(
'project'
)
.
DS
.
self
::
FILE_CONFIG_XML
))
{
die
(
'Cannot find module config file!'
);
}
$configFilePath
=
$this
->
getArg
(
'project'
)
.
DS
.
self
::
FILE_CONFIG_XML
;
/** @var $moduleConfigXml Varien_Simplexml_Element */
$moduleConfigXml
=
simplexml_load_file
(
$configFilePath
,
'Varien_Simplexml_Element'
);
if
(
!
isset
(
$moduleConfigXml
->
modules
->
EcomDev_PHPUnit
->
version
))
{
die
(
'Cannot retrieve module version!'
);
}
$version
=
$moduleConfigXml
->
modules
->
EcomDev_PHPUnit
->
version
;
return
$version
;
}
}
$shell
=
new
EcomDev_PHPUnit_Install
();
...
...
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