Commit acc11d7b authored by Ivan Chepurnyi's avatar Ivan Chepurnyi

! Fix Varien_Autoloader problem

parent cd16c12f
...@@ -9,17 +9,18 @@ env: ...@@ -9,17 +9,18 @@ env:
before_script: before_script:
# Fixing Magento hackathon installer # Fixing Magento hackathon installer
- mkdir -p tests/magento - mkdir -p tests/magento
# Installing required composer packages - mkdir bin/ && wget -O bin/mage-ci -q https://raw.github.com/EcomDev/MageCI/master/bin/mage-ci --no-check-certificate
- composer update --dev - chmod +x bin/mage-ci
# Installing magento version with prepared DB dump # Installing magento version with prepared DB dump
- vendor/bin/mage-ci install tests/magento $MAGE magento -c -t -r http://mage-ci.ecomdev.org - bin/mage-ci install tests/magento $MAGE magento -c -t -r http://mage-ci.ecomdev.org
# Installing EcomDev_PHPUnit module # Installing EcomDev_PHPUnit module
- vendor/bin/mage-ci install-module tests/magento $(pwd) - bin/mage-ci install-module tests/magento $(pwd)
# Configuring EcomDev_PHPUnit module # Configuring EcomDev_PHPUnit module
- CURRENT_DIR=$(pwd) - CURRENT_DIR=$(pwd)
- cd tests/magento/shell - cd tests/magento/shell
- php ecomdev-phpunit.php -a magento-config --db-name magento --same-db 1 --base_url http://test.magento.com/ - php ecomdev-phpunit.php -a magento-config --db-name magento --same-db 1 --base_url http://test.magento.com/
- php ecomdev-phpunit.php -a change-status --enable - php ecomdev-phpunit.php -a change-status --enable
- php ecomdev-phpunit.php -a fix-autoloader
- cd $CURRENT_DIR - cd $CURRENT_DIR
script: script:
- vendor/bin/mage-ci phpunit tests/magento --colors --coverage-text - vendor/bin/mage-ci phpunit tests/magento --colors --coverage-text
...@@ -8,19 +8,9 @@ ...@@ -8,19 +8,9 @@
"magento-hackathon/magento-composer-installer": "*", "magento-hackathon/magento-composer-installer": "*",
"phpunit/phpunit": "3.7.*" "phpunit/phpunit": "3.7.*"
}, },
"require-dev": {
"ecomdev/mage-ci": "dev-master"
},
"repositories": [{
"type": "composer",
"url": "http://packages.firegento.com"
}],
"authors":[ "authors":[
{ {
"name":"Ivan Chepurnyi" "name":"Ivan Chepurnyi"
} }
], ]
"extra": {
"magento-root-dir": "tests/magento"
}
} }
...@@ -114,6 +114,8 @@ Defined actions: ...@@ -114,6 +114,8 @@ Defined actions:
change-status Changes status of EcomDev_PHPUnitTest module, that contains built in supplied tests 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 --enable Used to determine the status of it. If not specified, it will be disabled
fix-autoloader Patches Varien_Autoload class to suppress include warning, that breaks class_exists().
USAGE; USAGE;
} }
...@@ -156,6 +158,9 @@ USAGE; ...@@ -156,6 +158,9 @@ USAGE;
$this->_cleanCache(); $this->_cleanCache();
echo "EcomDev_PHPUnitTest module status was changed\n"; echo "EcomDev_PHPUnitTest module status was changed\n";
break; break;
case 'fix-autoloader':
$this->_fixAutoloader();
break;
default: default:
$this->_showHelp(); $this->_showHelp();
break; break;
...@@ -299,7 +304,27 @@ USAGE; ...@@ -299,7 +304,27 @@ USAGE;
printf("Saved updated configuration at %s\n", $localXml); printf("Saved updated configuration at %s\n", $localXml);
} }
} }
/**
* Fixes Varien_Autoloader problem on phpunit test cases
*
*
*/
protected function _fixAutoloader()
{
$autoloaderFile = $this->getArg('project') . DIRECTORY_SEPARATOR . 'lib/Varien/Autoloader.php';
file_put_contents(
$autoloaderFile,
str_replace(
'return include $classFile;',
'return @include $classFile;',
file_get_contents($autoloaderFile)
)
);
echo "Varien_Autoloader was patched\n";
}
} }
$shell = new EcomDev_PHPUnit_Install(); $shell = new EcomDev_PHPUnit_Install();
$shell->run(); $shell->run();
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment