Skip to content

Commit

Permalink
Merge pull request #51 from magento-extensibility/develop
Browse files Browse the repository at this point in the history
[Extensibility] Eliminate Remnants of the Core Module (External Dev)
  • Loading branch information
vpelipenko committed Jan 22, 2015
2 parents 84ad348 + 3d139da commit cc38a64
Show file tree
Hide file tree
Showing 21 changed files with 53 additions and 50 deletions.
6 changes: 3 additions & 3 deletions app/code/Magento/Customer/Model/Resource/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
class Address extends \Magento\Eav\Model\Entity\AbstractEntity
{
/**
* @var \Magento\Core\Model\Validator\Factory
* @var \Magento\Framework\Validator\Factory
*/
protected $_validatorFactory;

Expand All @@ -28,7 +28,7 @@ class Address extends \Magento\Eav\Model\Entity\AbstractEntity
* @param \Magento\Framework\Locale\FormatInterface $localeFormat
* @param \Magento\Eav\Model\Resource\Helper $resourceHelper
* @param \Magento\Framework\Validator\UniversalFactory $universalFactory
* @param \Magento\Core\Model\Validator\Factory $validatorFactory
* @param \Magento\Framework\Validator\Factory $validatorFactory
* @param \Magento\Customer\Model\CustomerFactory $customerFactory
* @param array $data
*/
Expand All @@ -39,7 +39,7 @@ public function __construct(
\Magento\Framework\Locale\FormatInterface $localeFormat,
\Magento\Eav\Model\Resource\Helper $resourceHelper,
\Magento\Framework\Validator\UniversalFactory $universalFactory,
\Magento\Core\Model\Validator\Factory $validatorFactory,
\Magento\Framework\Validator\Factory $validatorFactory,
\Magento\Customer\Model\CustomerFactory $customerFactory,
$data = []
) {
Expand Down
6 changes: 3 additions & 3 deletions app/code/Magento/Customer/Model/Resource/Customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
class Customer extends \Magento\Eav\Model\Entity\AbstractEntity
{
/**
* @var \Magento\Core\Model\Validator\Factory
* @var \Magento\Framework\Validator\Factory
*/
protected $_validatorFactory;

Expand All @@ -37,7 +37,7 @@ class Customer extends \Magento\Eav\Model\Entity\AbstractEntity
* @param \Magento\Eav\Model\Resource\Helper $resourceHelper
* @param \Magento\Framework\Validator\UniversalFactory $universalFactory
* @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
* @param \Magento\Core\Model\Validator\Factory $validatorFactory
* @param \Magento\Framework\Validator\Factory $validatorFactory
* @param \Magento\Framework\Stdlib\DateTime $dateTime
* @param array $data
*/
Expand All @@ -49,7 +49,7 @@ public function __construct(
\Magento\Eav\Model\Resource\Helper $resourceHelper,
\Magento\Framework\Validator\UniversalFactory $universalFactory,
\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
\Magento\Core\Model\Validator\Factory $validatorFactory,
\Magento\Framework\Validator\Factory $validatorFactory,
\Magento\Framework\Stdlib\DateTime $dateTime,
$data = []
) {
Expand Down
6 changes: 3 additions & 3 deletions app/code/Magento/Email/Model/AbstractTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ abstract class AbstractTemplate extends AbstractModel implements TemplateTypesIn
protected $_design = null;

/**
* @var \Magento\Core\Model\App\Emulation
* @var \Magento\Store\Model\App\Emulation
*/
protected $_appEmulation;

Expand All @@ -69,15 +69,15 @@ abstract class AbstractTemplate extends AbstractModel implements TemplateTypesIn
* @param \Magento\Framework\Model\Context $context
* @param \Magento\Framework\View\DesignInterface $design
* @param \Magento\Framework\Registry $registry
* @param \Magento\Core\Model\App\Emulation $appEmulation
* @param \Magento\Store\Model\App\Emulation $appEmulation
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
* @param array $data
*/
public function __construct(
\Magento\Framework\Model\Context $context,
\Magento\Framework\View\DesignInterface $design,
\Magento\Framework\Registry $registry,
\Magento\Core\Model\App\Emulation $appEmulation,
\Magento\Store\Model\App\Emulation $appEmulation,
\Magento\Store\Model\StoreManagerInterface $storeManager,
array $data = []
) {
Expand Down
4 changes: 2 additions & 2 deletions app/code/Magento/Email/Model/BackendTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class BackendTemplate extends Template
* @param \Magento\Framework\Model\Context $context
* @param \Magento\Framework\View\DesignInterface $design
* @param \Magento\Framework\Registry $registry
* @param \Magento\Core\Model\App\Emulation $appEmulation
* @param \Magento\Store\Model\App\Emulation $appEmulation
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
* @param \Magento\Framework\Filesystem $filesystem
* @param \Magento\Framework\View\Asset\Repository $assetRepo
Expand All @@ -38,7 +38,7 @@ public function __construct(
\Magento\Framework\Model\Context $context,
\Magento\Framework\View\DesignInterface $design,
\Magento\Framework\Registry $registry,
\Magento\Core\Model\App\Emulation $appEmulation,
\Magento\Store\Model\App\Emulation $appEmulation,
\Magento\Store\Model\StoreManagerInterface $storeManager,
\Magento\Framework\Filesystem $filesystem,
\Magento\Framework\View\Asset\Repository $assetRepo,
Expand Down
4 changes: 2 additions & 2 deletions app/code/Magento/Email/Model/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ class Template extends \Magento\Email\Model\AbstractTemplate implements \Magento
* @param \Magento\Framework\Model\Context $context
* @param \Magento\Framework\View\DesignInterface $design
* @param \Magento\Framework\Registry $registry
* @param \Magento\Core\Model\App\Emulation $appEmulation
* @param \Magento\Store\Model\App\Emulation $appEmulation
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
* @param \Magento\Framework\Filesystem $filesystem
* @param \Magento\Framework\View\Asset\Repository $assetRepo
Expand All @@ -173,7 +173,7 @@ public function __construct(
\Magento\Framework\Model\Context $context,
\Magento\Framework\View\DesignInterface $design,
\Magento\Framework\Registry $registry,
\Magento\Core\Model\App\Emulation $appEmulation,
\Magento\Store\Model\App\Emulation $appEmulation,
StoreManagerInterface $storeManager,
\Magento\Framework\Filesystem $filesystem,
\Magento\Framework\View\Asset\Repository $assetRepo,
Expand Down
4 changes: 2 additions & 2 deletions app/code/Magento/Newsletter/Model/Queue.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class Queue extends \Magento\Email\Model\AbstractTemplate
* @param \Magento\Framework\Model\Context $context
* @param \Magento\Framework\View\DesignInterface $design
* @param \Magento\Framework\Registry $registry
* @param \Magento\Core\Model\App\Emulation $appEmulation
* @param \Magento\Store\Model\App\Emulation $appEmulation
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
* @param \Magento\Newsletter\Model\Template\Filter $templateFilter
* @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate
Expand All @@ -129,7 +129,7 @@ public function __construct(
\Magento\Framework\Model\Context $context,
\Magento\Framework\View\DesignInterface $design,
\Magento\Framework\Registry $registry,
\Magento\Core\Model\App\Emulation $appEmulation,
\Magento\Store\Model\App\Emulation $appEmulation,
\Magento\Store\Model\StoreManagerInterface $storeManager,
\Magento\Newsletter\Model\Template\Filter $templateFilter,
\Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate,
Expand Down
4 changes: 2 additions & 2 deletions app/code/Magento/Newsletter/Model/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class Template extends \Magento\Email\Model\AbstractTemplate
* @param \Magento\Framework\Model\Context $context
* @param \Magento\Framework\View\DesignInterface $design
* @param \Magento\Framework\Registry $registry
* @param \Magento\Core\Model\App\Emulation $appEmulation
* @param \Magento\Store\Model\App\Emulation $appEmulation
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
* @param \Magento\Framework\App\RequestInterface $request
* @param \Magento\Newsletter\Model\Template\Filter $filter
Expand All @@ -106,7 +106,7 @@ public function __construct(
\Magento\Framework\Model\Context $context,
\Magento\Framework\View\DesignInterface $design,
\Magento\Framework\Registry $registry,
\Magento\Core\Model\App\Emulation $appEmulation,
\Magento\Store\Model\App\Emulation $appEmulation,
\Magento\Store\Model\StoreManagerInterface $storeManager,
\Magento\Framework\App\RequestInterface $request,
\Magento\Newsletter\Model\Template\Filter $filter,
Expand Down
6 changes: 3 additions & 3 deletions app/code/Magento/Payment/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class Data extends \Magento\Framework\App\Helper\AbstractHelper
/**
* App emulation model
*
* @var \Magento\Core\Model\App\Emulation
* @var \Magento\Store\Model\App\Emulation
*/
protected $_appEmulation;

Expand All @@ -68,7 +68,7 @@ class Data extends \Magento\Framework\App\Helper\AbstractHelper
* @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
* @param LayoutFactory $layoutFactory
* @param \Magento\Payment\Model\Method\Factory $paymentMethodFactory
* @param \Magento\Core\Model\App\Emulation $appEmulation
* @param \Magento\Store\Model\App\Emulation $appEmulation
* @param \Magento\Payment\Model\Config $paymentConfig
* @param \Magento\Framework\App\Config\Initial $initialConfig
*/
Expand All @@ -77,7 +77,7 @@ public function __construct(
\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
LayoutFactory $layoutFactory,
\Magento\Payment\Model\Method\Factory $paymentMethodFactory,
\Magento\Core\Model\App\Emulation $appEmulation,
\Magento\Store\Model\App\Emulation $appEmulation,
\Magento\Payment\Model\Config $paymentConfig,
\Magento\Framework\App\Config\Initial $initialConfig
) {
Expand Down
6 changes: 3 additions & 3 deletions app/code/Magento/ProductAlert/Model/Email.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class Email extends \Magento\Framework\Model\AbstractModel
protected $customerRepository;

/**
* @var \Magento\Core\Model\App\Emulation
* @var \Magento\Store\Model\App\Emulation
*/
protected $_appEmulation;

Expand All @@ -114,7 +114,7 @@ class Email extends \Magento\Framework\Model\AbstractModel
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
* @param \Magento\Customer\Api\CustomerRepositoryInterface $customerRepository
* @param \Magento\Customer\Helper\View $customerHelper
* @param \Magento\Core\Model\App\Emulation $appEmulation
* @param \Magento\Store\Model\App\Emulation $appEmulation
* @param \Magento\Framework\Mail\Template\TransportBuilder $transportBuilder
* @param \Magento\Framework\Model\Resource\AbstractResource $resource
* @param \Magento\Framework\Data\Collection\Db $resourceCollection
Expand All @@ -128,7 +128,7 @@ public function __construct(
\Magento\Store\Model\StoreManagerInterface $storeManager,
\Magento\Customer\Api\CustomerRepositoryInterface $customerRepository,
\Magento\Customer\Helper\View $customerHelper,
\Magento\Core\Model\App\Emulation $appEmulation,
\Magento\Store\Model\App\Emulation $appEmulation,
\Magento\Framework\Mail\Template\TransportBuilder $transportBuilder,
\Magento\Framework\Model\Resource\AbstractResource $resource = null,
\Magento\Framework\Data\Collection\Db $resourceCollection = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
*
* @author Magento Core Team <core@magentocommerce.com>
*/
namespace Magento\Core\Model\App;
namespace Magento\Store\Model\App;

use Magento\Framework\Object;
use Magento\Framework\Translate\Inline\ConfigInterface;

class Emulation extends \Magento\Framework\Object
Expand Down Expand Up @@ -145,7 +146,7 @@ public function startEnvironmentEmulation(
*
* Function restores initial store environment
*
* @return \Magento\Core\Model\App\Emulation
* @return \Magento\Store\Model\App\Emulation
*/
public function stopEnvironmentEmulation()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ protected function setUp()
$objectManager->get('Magento\Framework\Model\Context'),
$objectManager->get('Magento\Framework\View\DesignInterface'),
$objectManager->get('Magento\Framework\Registry'),
$objectManager->get('Magento\Core\Model\App\Emulation'),
$objectManager->get('Magento\Store\Model\App\Emulation'),
$objectManager->get('Magento\Store\Model\StoreManager'),
$objectManager->create('Magento\Framework\Filesystem'),
$objectManager->create('Magento\Framework\View\Asset\Repository'),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php
/**
* Integration test for \Magento\Core\Model\Validator\Factory
* Integration test for \Magento\Framework\Validator\Factory
*
* Copyright © 2015 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Core\Model\Validator;
namespace Magento\Framework\Validator;

class FactoryTest extends \PHPUnit_Framework_TestCase
{
Expand All @@ -17,8 +17,8 @@ class FactoryTest extends \PHPUnit_Framework_TestCase
public function testGetValidatorConfig()
{
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
/** @var \Magento\Core\Model\Validator\Factory $factory */
$factory = $objectManager->get('Magento\Core\Model\Validator\Factory');
/** @var \Magento\Framework\Validator\Factory $factory */
$factory = $objectManager->get('Magento\Framework\Validator\Factory');
$this->assertInstanceOf('Magento\Framework\Validator\Config', $factory->getValidatorConfig());
// Check that default translator was set
$translator = \Magento\Framework\Validator\AbstractValidator::getDefaultTranslator();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@
* Copyright © 2015 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Core\Model\App;
namespace Magento\Store\Model\App;

class EmulationTest extends \PHPUnit_Framework_TestCase
{
/**
* @var \Magento\Core\Model\App\Emulation
* @var \Magento\Store\Model\App\Emulation
*/
protected $_model;

/**
* @covers \Magento\Core\Model\App\Emulation::startEnvironmentEmulation
* @covers \Magento\Core\Model\App\Emulation::stopEnvironmentEmulation
* @covers \Magento\Store\Model\App\Emulation::startEnvironmentEmulation
* @covers \Magento\Store\Model\App\Emulation::stopEnvironmentEmulation
*/
public function testEnvironmentEmulation()
{
$this->_model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
->create('Magento\Core\Model\App\Emulation');
->create('Magento\Store\Model\App\Emulation');
\Magento\TestFramework\Helper\Bootstrap::getInstance()
->loadArea(\Magento\Backend\App\Area\FrontNameResolver::AREA_CODE);
$design = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1302,6 +1302,7 @@
['Magento\Core\Controller\Varien\DispatchableInterface'],
['Magento\Core\Controller\Varien\Front', 'Magento\Framework\App\FrontController'],
['Magento\Core\Controller\FrontInterface', 'Magento\Framework\App\FrontControllerInterface'],
['Magento\Core\Model\App\Emulation', 'Magento\Store\Model\App\Emulation'],
['Magento\Core\Model\App\Handler'],
['Magento\Core\Model\App\Proxy'],
['Magento\Core\Model\Event\Config\SchemaLocator', 'Magento\Framework\Event\Config\SchemaLocator'],
Expand Down Expand Up @@ -2853,4 +2854,5 @@
['Magento\Sales\Model\Quote\Address\Total\Nominal\Collector'],
['Magento\Sales\Model\Quote\Address\Total\Nominal\Shipping'],
['Magento\Sales\Model\Quote\Address\Total\Nominal\Subtotal'],
['Magento\Core\Model\Validator\Factory', 'Magento\Framework\Validator\Factory'],
];
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ protected function prepareEavConfig()
/**
* Prepare validator mock object
*
* @return \Magento\Core\Model\Validator\Factory|\PHPUnit_Framework_MockObject_MockObject
* @return \Magento\Framework\Validator\Factory|\PHPUnit_Framework_MockObject_MockObject
*/
protected function prepareValidatorFactory()
{
Expand All @@ -240,7 +240,7 @@ protected function prepareValidatorFactory()
->willReturn(true);

$validatorFactory = $this->getMock(
'Magento\Core\Model\Validator\Factory',
'Magento\Framework\Validator\Factory',
['createValidator'],
[],
'',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function testGetType($templateType, $expectedResult)
$this->getMock('Magento\Framework\Model\Context', [], [], '', false),
$this->getMock('Magento\Core\Model\View\Design', [], [], '', false),
$this->getMock('Magento\Framework\Registry', [], [], '', false),
$this->getMock('Magento\Core\Model\App\Emulation', [], [], '', false),
$this->getMock('Magento\Store\Model\App\Emulation', [], [], '', false),
$this->getMock('Magento\Store\Model\StoreManager', [], [], '', false),
$this->getMock('Magento\Framework\Filesystem', [], [], '', false),
$this->getMock('Magento\Framework\View\Asset\Repository', [], [], '', false),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php
/**
* Unit test for \Magento\Core\Model\Validator\Factory
* Unit test for \Magento\Framework\Validator\Factory
*
* Copyright © 2015 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Core\Model\Validator;
namespace Magento\Framework\Validator;

class FactoryTest extends \PHPUnit_Framework_TestCase
{
Expand Down Expand Up @@ -104,7 +104,7 @@ protected function tearDown()
*/
public function testGetValidatorConfig()
{
$factory = new \Magento\Core\Model\Validator\Factory(
$factory = new \Magento\Framework\Validator\Factory(
$this->_objectManager,
$this->_config,
$this->_translateAdapter
Expand Down Expand Up @@ -144,7 +144,7 @@ public function testCreateValidatorBuilder()
$objectManager->getObject('Magento\Framework\Validator\Builder', ['constraints' => []])
)
);
$factory = new \Magento\Core\Model\Validator\Factory(
$factory = new \Magento\Framework\Validator\Factory(
$this->_objectManager,
$this->_config,
$this->_translateAdapter
Expand All @@ -171,7 +171,7 @@ public function testCreateValidator()
)->will(
$this->returnValue(new \Magento\Framework\Validator())
);
$factory = new \Magento\Core\Model\Validator\Factory(
$factory = new \Magento\Framework\Validator\Factory(
$this->_objectManager,
$this->_config,
$this->_translateAdapter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function testGetProcessedTemplate($isSingleStore)
}

$filter = $this->getMock('Magento\Newsletter\Model\Template\Filter', [], [], '', false);
$appEmulation = $this->getMock('Magento\Core\Model\App\Emulation', [], [], '', false);
$appEmulation = $this->getMock('Magento\Store\Model\App\Emulation', [], [], '', false);
$filter->expects($this->once())->method('setStoreId')->with('test_id');
$filter->expects($this->once())->method('setIncludeProcessor')->will($this->returnSelf());
$filter->expects(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ protected function setUp()
$layoutFactoryMock->expects($this->once())->method('create')->willReturn($this->layoutMock);

$this->methodFactory = $this->getMock('Magento\Payment\Model\Method\Factory', [], [], '', false);
$this->appEmulation = $this->getMock('Magento\Core\Model\App\Emulation', [], [], '', false);
$this->appEmulation = $this->getMock('Magento\Store\Model\App\Emulation', [], [], '', false);
$paymentConfig = $this->getMock('Magento\Payment\Model\Config', [], [], '', false);
$this->initialConfig = $this->getMock('Magento\Framework\App\Config\Initial', [], [], '', false);

Expand Down
Loading

0 comments on commit cc38a64

Please sign in to comment.