/** * {@inheritdoc} */ protected function execute(InputInterface $input, OutputInterface $output) { /* parse arguments */ $argIds = $input->getArgument(static::ARG_IDS); if (is_null($argIds)) { $ids = null; $output->writeln('<info>List of all products will be pulled from Odoo.<info>'); } else { $ids = explode(',', $argIds); $output->writeln("<info>Products with Odoo IDs ({$argIds}) will be pulled from Odoo.<info>"); } /* setup session */ $this->_setAreaCode(); /* call service operation */ /** @var ProductsFromOdooRequest $req */ $req = $this->_manObj->create(ProductsFromOdooRequest::class); $req->setOdooIds($ids); /** @var ProductsFromOdooResponse $resp */ $resp = $this->_callReplicate->productsFromOdoo($req); if ($resp->isSucceed()) { $output->writeln('<info>Replication is done.<info>'); } else { $output->writeln('<info>Replication is failed.<info>'); } }
public function test_productsFromOdoo() { $req = new Request\ProductsFromOdoo(); $resp = $this->obj->productsFromOdoo($req); $this->assertNotNull($resp); }