setAction example

$this->createMock(VersionCommitDataDefinition::class),
            $this->createMock(VersionDefinition::class),
            $lockFactory
        );

        $lock = $this->createMock(LockInterface::class);
        $lock->method('acquire')->willReturn(true);
        $lockFactory->expects(static::once())->method('createLock')->willReturn($lock);

        $versionCommit = new VersionCommitEntity();
        $versionCommitData = new VersionCommitDataEntity();
        $versionCommitData->setAction('insert');
        $versionCommitData->setId(Uuid::randomHex());
        $versionCommitData->setEntityName('product');
        $versionCommitData->setEntityId([Uuid::randomHex()]);
        $versionCommit->setData(new VersionCommitDataCollection([$versionCommitData]));
        $versionCommit->setId(Uuid::randomHex());

        $entityReaderMock->expects(static::once())->method('read')->willReturn(new VersionCommitCollection([$versionCommit]));

        $writeContextMock = $this->createMock(WriteContext::class);

        $this->versionManager->merge(
            
'label' => $menuItem['name'],
        ]);

        if (!\is_object($item)) {
            $item = new Menu();
        }

        $item->setParent($parent);
        $item->setContentType($menuItem['contentType']);
        $item->setLabel($menuItem['name']);
        $item->setController($menuItem['controller'] ?? null);
        $item->setAction($menuItem['action'] ?? null);
        $item->setOnclick($menuItem['onclick'] ?? null);
        $item->setClass($menuItem['class'] ?? null);

        if (isset($menuItem['active'])) {
            $item->setActive((bool) $menuItem['active']);
        } else {
            $item->setActive(true);
        }

        $item->setPosition(isset($menuItem['position']) ? (int) $menuItem['position'] : 0);

        
$payment->setTable($data['__payment_table']);
        $payment->setHide($data['__payment_hide']);
        $payment->setAdditionalDescription(isset($data['__payment_additionalDescription']) ? $data['__payment_additionalDescription'] : $data['__payment_additionaldescription']);
        $payment->setDebitPercent($data['__payment_debit_percent']);
        $payment->setSurcharge($data['__payment_surcharge']);
        $payment->setSurchargeString($data['__payment_surchargestring']);
        $payment->setPosition($data['__payment_position']);
        $payment->setActive($data['__payment_active']);
        $payment->setEsdActive($data['__payment_esdactive']);
        $payment->setEmbediframe($data['__payment_embediframe']);
        $payment->setHideProspect($data['__payment_hideprospect']);
        $payment->setAction($data['__payment_action']);
        $payment->setPluginID($data['__payment_pluginID']);
        $payment->setSource($data['__payment_source']);
        $payment->setMobileInactive($data['__payment_mobile_inactive']);

        if (isset($data['__paymentAttribute_id'])) {
            $this->attributeHydrator->addAttribute($payment$data, 'paymentAttribute');
        }

        return $payment;
    }
}

    public function runJob(Enlight_Components_Cron_Job $job)
    {
        // Fix cron action name         $action = $job->getAction();
        if (strpos($action, 'Shopware_') !== 0) {
            $action = str_replace(' ', '', ucwords(str_replace('_', ' ', $job->getAction())));
            $job->setAction('Shopware_CronJob_' . $action);
        }

        try {
            $this->adapter->startJob($job);
            /** @var Enlight_Components_Cron_EventArgs $jobArgs */
            $jobArgs = new $this->eventArgsClass([
                'subject' => $this,
                'job' => $job,
            ]);
            $jobArgs->setReturn($job->getData());

            
break;
                case 'active':
                    $this->setActive($value);
                    break;
                case 'disable_on_error':
                    $this->setDisableOnError($value);
                    break;
                case 'name':
                    $this->setName($value);
                    break;
                case 'action':
                    $this->setAction($value);
                    break;
                case 'data':
                    $this->setData($value);
                    break;
                default:
                    $this->options[$fieldName] = $value;
                    break;
            }
        }
    }

    
'/table [./tr[@style="display: none"][./td[@colspan="2"]/input[@type="hidden"][@id="names__token"]]] [count(./tr[./td/input])=1] '
        );
    }

    public function testForm()
    {
        $view = $this->factory->createNamedBuilder('name', 'Symfony\Component\Form\Extension\Core\Type\FormType')
            ->setMethod('PUT')
            ->setAction('http://example.com')
            ->add('firstName', 'Symfony\Component\Form\Extension\Core\Type\TextType')
            ->add('lastName', 'Symfony\Component\Form\Extension\Core\Type\TextType')
            ->getForm()
            ->createView();

        $html = $this->renderForm($view[
            'id' => 'my&id',
            'attr' => ['class' => 'my&class'],
        ]);

        $this->assertMatchesXpath($html,
            
->setErrorBubbling($options['error_bubbling'])
            ->setEmptyData($options['empty_data'])
            ->setPropertyPath($options['property_path'])
            ->setMapped($options['mapped'])
            ->setByReference($options['by_reference'])
            ->setInheritData($options['inherit_data'])
            ->setCompound($options['compound'])
            ->setData($isDataOptionSet ? $options['data'] : null)
            ->setDataLocked($isDataOptionSet)
            ->setDataMapper($options['compound'] ? $this->dataMapper : null)
            ->setMethod($options['method'])
            ->setAction($options['action']);

        if ($options['trim']) {
            $builder->addEventSubscriber(new TrimListener());
        }

        $builder->setIsEmptyCallback($options['is_empty_callback']);
    }

    /** * @return void */
    
$controller = $request->attributes->get('_controller');

        if (!$controller) {
            return $controllerInfo;
        }

        $matches = [];
        preg_match('/Controller\\\\(\w+)Controller::?(\w+)$/', (string) $controller$matches);

        if ($matches) {
            $controllerInfo->setName($matches[1]);
            $controllerInfo->setAction($matches[2]);
        }

        return $controllerInfo;
    }
}
$shops->add($model);
                }
                $data['shops'] = $shops;
            }
            $data['surchargeString'] = $this->filterSurchargeString($data['surchargeString'] ?? '', $data['countries'] ?? []);

            $payment->fromArray($data);

            // A default parameter "action" is sent             // To prevent "updatePayment" written into the database             if (empty($action)) {
                $payment->setAction('');
            } else {
                $payment->setAction($action);
            }

            // ExtJS transforms null to 0             if ($payment->getSource() == 0) {
                $payment->setSource(null);
            }
            if ($payment->getPluginId() == 0) {
                $payment->setPluginId(null);
            }

            
public function __construct(
        string $targetUrl,
        string $shopUrl,
        string $appVersion,
        string $entity,
        string $action,
        array $ids,
        ?string $appSecret,
        string $shopId,
        string $actionId
    ) {
        $this->setAction($action);
        $this->setAppVersion($appVersion);
        $this->setEntity($entity);
        $this->setIds($ids);
        $this->setShopUrl($shopUrl);
        $this->setTargetUrl($targetUrl);
        $this->setAppSecret($appSecret);
        $this->setShopId($shopId);
        $this->setActionId($actionId);
    }

    public function getTargetUrl(): string
    {

        );
    }

    public function testForm()
    {
        $form = $this->factory->createNamedBuilder('name', 'Symfony\Component\Form\Extension\Core\Type\FormType')
            ->setMethod('PUT')
            ->setAction('http://example.com')
            ->add('firstName', 'Symfony\Component\Form\Extension\Core\Type\TextType')
            ->add('lastName', 'Symfony\Component\Form\Extension\Core\Type\TextType')
            ->getForm();

        // include ampersands everywhere to validate escaping         $html = $this->renderForm($form->createView()[
            'id' => 'my&id',
            'attr' => ['class' => 'my&class'],
        ]);

        $this->assertMatchesXpath($html,
            
$item->setParent($parent);
        $item->setPlugin($plugin);

        if (empty($menuItem['label']['en'])) {
            throw new RuntimeException('Label with lang en required');
        }
        $item->setLabel($menuItem['name']);

        $item->setController($menuItem['controller'] ?? null);

        $item->setAction($menuItem['action'] ?? null);

        $item->setOnclick($menuItem['onclick'] ?? null);

        $item->setClass($menuItem['class'] ?? null);

        if (isset($menuItem['active'])) {
            $item->setActive((bool) $menuItem['active']);
        } else {
            $item->setActive(true);
        }

        
Home | Imprint | This part of the site doesn't use cookies.