예제 #1
0
 /**
  * {@inheritDoc}
  */
 public function load(ObjectManager $om)
 {
     $this->organization = $this->getReference('default_organization');
     $this->users = $om->getRepository('OroUserBundle:User')->findAll();
     $website = new Website();
     $website->setCode('admin')->setName('Admin');
     $om->persist($website);
     $store = new Store();
     $store->setCode('admin')->setName('Admin')->setWebsite($website);
     $om->persist($store);
     $transport = new MagentoSoapTransport();
     $transport->setApiUser('api_user');
     $transport->setApiKey('api_key');
     $transport->setExtensionVersion(SoapTransport::REQUIRED_EXTENSION_VERSION);
     $transport->setIsExtensionInstalled(true);
     $transport->setMagentoVersion('1.9.1.0');
     $transport->setWsdlUrl('http://magento.domain');
     $om->persist($transport);
     $integration = new Integration();
     $integration->setType('magento');
     $integration->setConnectors(['customer', 'cart', 'order', 'newsletter_subscriber']);
     $integration->setName(self::INTEGRATION_NAME);
     $integration->setTransport($transport);
     $integration->setOrganization($this->organization);
     $om->persist($integration);
     $builder = $this->factory->createBuilderForIntegration($integration);
     $builder->setOwner($integration->getOrganization());
     $builder->setDataSource($integration);
     $builder->setStatus($integration->isEnabled() ? Channel::STATUS_ACTIVE : Channel::STATUS_INACTIVE);
     $this->dataChannel = $builder->getChannel();
     $om->persist($this->dataChannel);
     $group = new CustomerGroup();
     $group->setName('General');
     $group->setOriginId(15000);
     $group->setChannel($integration);
     $om->persist($group);
     $om->flush();
     $this->persistDemoCustomers($om, $website, $store, $group, $integration);
     $om->flush();
     $this->persistDemoCarts($om, $store, $integration);
     $om->flush();
     $this->persistDemoOrders($om, $store, $integration);
     $om->flush();
     $this->persistDemoRFM($om);
     $om->flush();
 }
예제 #2
0
 /**
  * @return $this
  */
 protected function createTransport()
 {
     $transport = new MagentoSoapTransport();
     $transport->setAdminUrl('http://localhost/magento/admin');
     $transport->setApiKey('key');
     $transport->setApiUser('user');
     $transport->setIsExtensionInstalled(true);
     $transport->setIsWsiMode(false);
     $transport->setWebsiteId('1');
     $transport->setWsdlUrl('http://localhost/magento/api/v2_soap?wsdl=1');
     $transport->setWebsites([['id' => 1, 'label' => 'Website ID: 1, Stores: English, French, German']]);
     $this->em->persist($transport);
     $this->transport = $transport;
     return $this;
 }
 public function testOnChannelSucceedSave()
 {
     $this->entity->setChannelType(ChannelType::TYPE);
     $transport = new MagentoSoapTransport();
     $transport->setIsExtensionInstalled(false);
     $this->integration->setTransport($transport);
     $this->typesRegistry->expects($this->any())->method('getRegisteredConnectorsTypes')->willReturn(new ArrayCollection([]));
     $this->prepareEvent();
     $this->getListener()->onChannelSucceedSave($this->event);
 }