Permalink
Browse files

Published additional tests and fixes

- Various code integrity fixes in different places:
-- Fixed obsolete references to classes
-- Fixed broken references to template and static view files
-- Fixed some minor occurrences of deprecated code
-- Code style minor fixes
- Various minor bugfixes
- Implemented "developer mode" in integration tests
- Added "rollback" scripts capability for data fixtures
- Removed deprecated methods and attributes from product type class
- Restructured code integrity tests:
-- Moved out part of the tests from integration into static tests
-- Introduced "Legacy" test suite in static tests. This test suite is not executed by default when running either phpunit directly or using the "batch tool"
-- Simplified and reorganized the "Exemplar" and self-assessment tests for static code analysis
- Covered previously made backwards-incompatible changes with legacy tests
- Changed storage of class map from a PHP-file with array into a better-performing text file with serialized array.
- Published dev/tests/static and dev/tests/unit
  • Loading branch information...
magento-team committed Dec 28, 2011
1 parent 9b9ce2c commit 68bdc66b233a55f27af17e0ae257f0db5c811aa9
Showing 302 changed files with 10,088 additions and 377 deletions.
View
@@ -82,9 +82,12 @@
$paths[] = BP . DS . 'app' . DS . 'code' . DS . 'community';
$paths[] = BP . DS . 'app' . DS . 'code' . DS . 'core';
$paths[] = BP . DS . 'lib';
+Magento_Autoload::getInstance()->addIncludePath($paths);
-Magento_Autoload::getInstance()->addIncludePath($paths)
- ->addFilesMap(BP . '/_classmap.php');
+$classMapPath = BP . DS . 'var/classmap.ser';
+if (file_exists($classMapPath)) {
+ Magento_Autoload::getInstance()->addFilesMap($classMapPath);
+}
#Magento_Profiler::enable();
#Magento_Profiler::registerOutput(new Magento_Profiler_Output_Html());
@@ -13,9 +13,15 @@
* obtain it through the world-wide-web, please send an email
* to license@magentocommerce.com so we can send you a copy immediately.
*
+ * DISCLAIMER
+ *
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
+ * versions in the future. If you wish to customize Magento for your
+ * needs please refer to http://www.magentocommerce.com for more information.
+ *
* @category Phoenix
* @package Phoenix_Moneybookers
- * @copyright Copyright (c) 2009 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de)
+ * @copyright Copyright (c) 2011 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
-->
@@ -311,6 +311,20 @@ protected function _insertAttribute($object, $attribute, $value)
return $this->_saveAttributeValue($object, $attribute, $value);
}
+ /**
+ * Update entity attribute value
+ *
+ * @param Varien_Object $object
+ * @param Mage_Eav_Model_Entity_Attribute_Abstract $attribute
+ * @param mixed $valueId
+ * @param mixed $value
+ * @return Mage_Catalog_Model_Resource_Abstract
+ */
+ protected function _updateAttribute($object, $attribute, $valueId, $value)
+ {
+ return $this->_saveAttributeValue($object, $attribute, $value);
+ }
+
/**
* Update attribute value for specific store
*
@@ -1241,7 +1241,7 @@ public function getHelperClassName($helperClass)
* Retrieve resource helper instance
*
* Example:
- * $config->getResourceHelper('Mage_Cms')
+ * $config->getResourceHelper('Mage_Core')
* will instantiate Mage_Cms_Model_Resource_Helper_<db_adapter_name>
*
* @param string $moduleName
@@ -31,7 +31,6 @@
* @package Mage_Core
* @author Magento Core Team <core@magentocommerce.com>
*/
-//class Mage_Core_Model_Convert extends Varien_Convert_Profile_Collection
class Mage_Core_Model_Convert extends Mage_Dataflow_Model_Convert_Profile_Collection
{
public function __construct()
@@ -31,7 +31,7 @@
* @package Mage_Shell
* @author Magento Core Team <core@magentocommerce.com>
*/
-abstract class Mage_Core_Model_Shell_Abstract
+abstract class Mage_Core_Model_ShellAbstract
{
/**
* Raw arguments, that should be parsed
@@ -75,7 +75,7 @@ public function __construct($entryPoint)
* Sets raw arguments to be parsed
*
* @param array $args
- * @return Mage_Core_Model_Shell_Abstract
+ * @return Mage_Core_Model_ShellAbstract
*/
public function setRawArgs($args)
{
@@ -98,7 +98,7 @@ protected function _getRootPath()
/**
* Parses .htaccess file and apply php settings to shell script
*
- * @return Mage_Core_Model_Shell_Abstract
+ * @return Mage_Core_Model_ShellAbstract
*/
protected function _applyPhpVariables()
{
@@ -126,7 +126,7 @@ protected function _applyPhpVariables()
/**
* Parses input arguments
*
- * @return Mage_Core_Model_Shell_Abstract
+ * @return Mage_Core_Model_ShellAbstract
*/
protected function _parseArgs()
{
@@ -150,7 +150,7 @@ protected function _parseArgs()
/**
* Runs script
*
- * @return Mage_Core_Model_Shell_Abstract
+ * @return Mage_Core_Model_ShellAbstract
*/
abstract public function run();
@@ -54,7 +54,7 @@ class Mage_Directory_Model_Resource_Currency extends Mage_Core_Model_Resource_Db
*/
protected function _construct()
{
- $this->_init('Mage_Directory_Model_Currency', 'currency_code');
+ $this->_init('directory_currency', 'currency_code');
$this->_currencyRateTable = $this->getTable('directory_currency_rate');
}
@@ -374,7 +374,7 @@ public function expandSource()
$count = self::MAX_IMPORT_CHUNKS;
for ($i = 1; $i < $count; $i++) {
$writer = Mage::getModel(
- 'importexport/export_adapter_csv',
+ 'Mage_ImportExport_Model_Export_Adapter_Csv',
self::getWorkingDir() . sprintf($filenameFormat, $i)
);
@@ -1,4 +1,30 @@
<?xml version="1.0"?>
+<!--
+/**
+ * Magento
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Academic Free License (AFL 3.0)
+ * that is bundled with this package in the file LICENSE_AFL.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://opensource.org/licenses/afl-3.0.php
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@magentocommerce.com so we can send you a copy immediately.
+ *
+ * DISCLAIMER
+ *
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
+ * versions in the future. If you wish to customize Magento for your
+ * needs please refer to http://www.magentocommerce.com for more information.
+ *
+ * @category Mage
+ * @package Mage_ImportExport
+ * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
+ */
+-->
<layout>
<adminhtml_import_index>
<reference name="content">
@@ -31,7 +31,7 @@
* @package Mage_Shell
* @author Magento Core Team <core@magentocommerce.com>
*/
-class Mage_Index_Model_Shell extends Mage_Core_Model_Shell_Abstract
+class Mage_Index_Model_Shell extends Mage_Core_Model_ShellAbstract
{
/**
* Gets indexer instance
@@ -31,7 +31,7 @@
* @package Mage_Log
* @author Magento Core Team <core@magentocommerce.com>
*/
-class Mage_Log_Model_Shell extends Mage_Core_Model_Shell_Abstract
+class Mage_Log_Model_Shell extends Mage_Core_Model_ShellAbstract
{
/**
* Converts count to human view
@@ -43,7 +43,7 @@ protected function _toHtml()
{
/** @var $listXmlObj Mage_XmlConnect_Model_Simplexml_Element */
$methodListXmlObj = Mage::getModel(
- 'xmlconnect/simplexml_element',
+ 'Mage_XmlConnect_Model_Simplexml_Element',
'<shipping_method_list></shipping_method_list>'
);
@@ -106,7 +106,7 @@ protected function _toHtml()
$action = Mage::helper('Mage_XmlConnect_Helper_Data')->getActionUrl('xmlconnect/customer/saveaddress');
/** @var Mage_XmlConnect_Model_Simplexml_Form $fromXmlObj */
- $fromXmlObj = Mage::getModel('xmlconnect/simplexml_form', array(
+ $fromXmlObj = Mage::getModel('Mage_XmlConnect_Model_Simplexml_Form', array(
'xml_id' => 'address_form',
'action' => $action,
'use_container' => true
@@ -1,78 +0,0 @@
-<?php
-/**
- * Magento
- *
- * NOTICE OF LICENSE
- *
- * This source file is subject to the Open Software License (OSL 3.0)
- * that is bundled with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://opensource.org/licenses/osl-3.0.php
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@magentocommerce.com so we can send you a copy immediately.
- *
- * DISCLAIMER
- *
- * Do not edit or add to this file if you wish to upgrade Magento to newer
- * versions in the future. If you wish to customize Magento for your
- * needs please refer to http://www.magentocommerce.com for more information.
- *
- * @category Magento
- * @package Test
- * @subpackage integration_tests
- * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
- */
-
-/**
- * An ancestor class for tests, that visit many files, and where more visiting method can be added with time
- */
-abstract class Magento_Test_TestCase_VisitorAbstract extends PHPUnit_Framework_TestCase
-{
- /**
- * List of methods in this class, that are designed to check file content.
- * Filled automatically via reflection.
- *
- * @var array
- */
- protected $_visitorMethods = null;
-
- /**
- * Returns all methods in this class, that are designed to visit the file content.
- * Protected methods starting with '_visit' are considered to be visitor methods.
- *
- * @return array
- */
- protected function _getVisitorMethods()
- {
- if ($this->_visitorMethods === null) {
- $this->_visitorMethods = array();
- $reflection = new ReflectionClass($this);
- foreach ($reflection->getMethods(ReflectionMethod::IS_PROTECTED) as $method) {
- if (substr($method->name, 0, 6) == '_visit') {
- $this->_visitorMethods[] = $method->name;
- }
- }
- }
-
- return $this->_visitorMethods;
- }
-
- /**
- * Checks whether file path has required extension
- *
- * @param string|array $extensions
- * @return bool
- */
- protected function _fileHasExtensions($fileInfo, $extensions)
- {
- if (is_string($extensions)) {
- $extensions = array($extensions);
- }
-
- $fileExtension = pathinfo($fileInfo->getBasename(), PATHINFO_EXTENSION);
- $key = array_search($fileExtension, $extensions);
- return ($key !== false);
- }
-}
@@ -1,2 +1,28 @@
<?php
+/**
+ * Magento
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Open Software License (OSL 3.0)
+ * that is bundled with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://opensource.org/licenses/osl-3.0.php
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@magentocommerce.com so we can send you a copy immediately.
+ *
+ * DISCLAIMER
+ *
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
+ * versions in the future. If you wish to customize Magento for your
+ * needs please refer to http://www.magentocommerce.com for more information.
+ *
+ * @category Magento
+ * @package Magento
+ * @subpackage integration_tests
+ * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
+ */
+
// Empty texture for test purpose
@@ -23,4 +23,4 @@
* @subpackage integration_tests
* @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
- */
+ */
@@ -23,4 +23,4 @@
* @subpackage integration_tests
* @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
- */
+ */
Oops, something went wrong.

0 comments on commit 68bdc66

Please sign in to comment.