public function testGet() { $optionId = 1; $productSku = 'simple_product'; $this->productRepositoryMock->expects($this->once())->method('get')->with($productSku, false)->willReturn($this->productMock); $this->productMock->expects($this->once())->method('getOptionById')->with($optionId)->willReturn($this->optionMock); $this->assertEquals($this->optionMock, $this->optionRepository->get($productSku, $optionId)); }
protected function registerEventListeners() { $registrationModel = $this->config->get('auth::registration_strategy'); switch ($registrationModel) { case 'single_opt_in': $this->event->listen('Ipunkt.Auth.*', 'Ipunkt\\Auth\\Listeners\\SingleOptInListener'); break; case 'double_opt_in': $this->event->listen('Ipunkt.Auth.*', 'Ipunkt\\Auth\\Listeners\\DoubleOptInListener'); break; default: } }
/** * @param Job $job * @param mixed $models */ public function fire(Job $job, $models) { $loggerContainerBinding = $this->config->get('logger', 'menthol.flexible.logger'); $logger = $this->app->make($loggerContainerBinding); foreach ($models as $model) { list($class, $id) = explode(':', $model); $logger->info('Deleting ' . $class . ' with ID: ' . $id . ' from Elasticsearch'); $model = new $class(); if (method_exists($model, 'getProxy')) { $model->deleteDoc($id); } } $job->delete(); }
/** * Get the default provider driver name. * * @throws UnknownPaymentGatewayException * * @return string */ public function getDefaultDriver() { $driver = strtolower($this->config->get('lara-pay-ng.gateways.driver')); if (in_array($driver, ['gtpay', 'webpay', 'voguepay', 'simplepay', 'cashenvoy'])) { return $driver; } throw new UnknownPaymentGatewayException(); }
/** * @param $gateway * @param $key * @param $keywithdot * * @return mixed|string */ private function getGatewayConfig($gateway, $key, $keywithdot) { if ($key == '*') { return $this->config->get('lara-pay-ng.gateways.' . $gateway); } if (!array_key_exists($key, $this->config->get('lara-pay-ng.gateways.' . $gateway))) { return 'Trying to get an Unknown ' . $gateway . ' Config'; } return $this->config->get('lara-pay-ng.gateways.' . $gateway . $keywithdot); }
public function testGet() { $attributeCode = 'some attribute code'; $this->eavAttributeRepositoryMock->expects($this->once())->method('get')->with(\Magento\Catalog\Api\Data\ProductAttributeInterface::ENTITY_TYPE_CODE, $attributeCode); $this->model->get($attributeCode); }