Commit 6decd776 authored by Ivan Chepurnyi's avatar Ivan Chepurnyi

! Fix Issue #18 : compatibility with Magento 1.6.x and higher. Were problem...

! Fix Issue #18 : compatibility with Magento 1.6.x and higher. Were problem with PK autoincrement fields
parent b0fd8e25
...@@ -803,11 +803,11 @@ class EcomDev_PHPUnit_Model_Fixture ...@@ -803,11 +803,11 @@ class EcomDev_PHPUnit_Model_Fixture
$scopeModel = Mage::getModel(self::$_scopeModelByType[$type]); $scopeModel = Mage::getModel(self::$_scopeModelByType[$type]);
$scopeModel->setData($row); $scopeModel->setData($row);
// Change property for saving new objects with specified ids // Change property for saving new objects with specified ids
EcomDev_Utils_Reflection::setRestrictedPropertyValues( EcomDev_Utils_Reflection::setRestrictedPropertyValues(
$scopeModel->getResource(), $scopeModel->getResource(),
array( array(
'_useIsObjectNew' => true,
'_isPkAutoIncrement' => false '_isPkAutoIncrement' => false
) )
); );
...@@ -818,7 +818,6 @@ class EcomDev_PHPUnit_Model_Fixture ...@@ -818,7 +818,6 @@ class EcomDev_PHPUnit_Model_Fixture
EcomDev_Utils_Reflection::setRestrictedPropertyValues( EcomDev_Utils_Reflection::setRestrictedPropertyValues(
$scopeModel->getResource(), $scopeModel->getResource(),
array( array(
'_useIsObjectNew' => false,
'_isPkAutoIncrement' => true '_isPkAutoIncrement' => true
) )
); );
...@@ -884,4 +883,5 @@ class EcomDev_PHPUnit_Model_Fixture ...@@ -884,4 +883,5 @@ class EcomDev_PHPUnit_Model_Fixture
Mage::app()->reinitStores(); Mage::app()->reinitStores();
return $this; return $this;
} }
} }
...@@ -597,7 +597,7 @@ abstract class EcomDev_PHPUnit_Test_Case extends PHPUnit_Framework_TestCase ...@@ -597,7 +597,7 @@ abstract class EcomDev_PHPUnit_Test_Case extends PHPUnit_Framework_TestCase
* *
* @param string $type * @param string $type
* @param string $classAlias * @param string $classAlias
* @param array $methods * @param array|null $methods
* @param boolean $isAbstract * @param boolean $isAbstract
* @param array $constructorArguments * @param array $constructorArguments
* @param string $mockClassAlias * @param string $mockClassAlias
...@@ -606,7 +606,7 @@ abstract class EcomDev_PHPUnit_Test_Case extends PHPUnit_Framework_TestCase ...@@ -606,7 +606,7 @@ abstract class EcomDev_PHPUnit_Test_Case extends PHPUnit_Framework_TestCase
* @param boolean $callAutoload * @param boolean $callAutoload
* @return PHPUnit_Framework_MockObject_MockObject * @return PHPUnit_Framework_MockObject_MockObject
*/ */
public function getGroupedClassMock($type, $classAlias, array $methods = array(), $isAbstract = false, public function getGroupedClassMock($type, $classAlias, $methods = array(), $isAbstract = false,
array $constructorArguments = array(), array $constructorArguments = array(),
$mockClassAlias = '', $callOriginalConstructor = true, $mockClassAlias = '', $callOriginalConstructor = true,
$callOriginalClone = true, $callAutoload = true) $callOriginalClone = true, $callAutoload = true)
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
<directory suffix=".php">app/code/community/EcomDev/PHPUnit</directory> <directory suffix=".php">app/code/community/EcomDev/PHPUnit</directory>
<directory suffix=".php">lib/EcomDev/Utils</directory> <directory suffix=".php">lib/EcomDev/Utils</directory>
<directory suffix=".php">lib/EcomDev/PHPUnit</directory> <directory suffix=".php">lib/EcomDev/PHPUnit</directory>
<directory suffix=".php">lib/Spyc</directory>
<!-- Exclude Mage.php file from code coverage --> <!-- Exclude Mage.php file from code coverage -->
<file>app/Mage.php</file> <file>app/Mage.php</file>
<!-- Exclude template files --> <!-- Exclude template files -->
......
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