/**
  * Assert that product is not present in Wishlist on Frontend
  *
  * @param CustomerAccountIndex $customerAccountIndex
  * @param WishlistIndex $wishlistIndex
  * @param InjectableFixture $product
  * @param CustomerInjectable $customer
  * @param CmsIndex $cmsIndex
  * @param CustomerAccountLogin $customerAccountLogin
  * @param CustomerAccountLogout $customerAccountLogout
  * @return void
  */
 public function processAssert(CustomerAccountIndex $customerAccountIndex, WishlistIndex $wishlistIndex, InjectableFixture $product, CustomerInjectable $customer, CmsIndex $cmsIndex, CustomerAccountLogin $customerAccountLogin, CustomerAccountLogout $customerAccountLogout)
 {
     $productName = $product->getName();
     $customerAccountLogout->open();
     $cmsIndex->getLinksBlock()->openLink('Log In');
     $customerAccountLogin->getLoginBlock()->login($customer);
     $customerAccountIndex->open()->getAccountMenuBlock()->openMenuItem("My Wish List");
     \PHPUnit_Framework_Assert::assertFalse($wishlistIndex->getWishlistBlock()->getProductItemsBlock()->isProductPresent($productName), 'Product \'' . $productName . '\' is present in Wishlist on Frontend.');
 }
 /**
  * Constructor
  *
  * @constructor
  * @param Config $configuration
  * @param RepositoryFactory $repositoryFactory
  * @param FixtureFactory $fixtureFactory
  * @param HandlerFactory $handlerFactory
  * @param EventManagerInterface $eventManager
  * @param array $data
  * @param string $dataSet
  * @param bool $persist
  */
 public function __construct(Config $configuration, RepositoryFactory $repositoryFactory, FixtureFactory $fixtureFactory, HandlerFactory $handlerFactory, EventManagerInterface $eventManager, array $data = [], $dataSet = '', $persist = false)
 {
     parent::__construct($configuration, $repositoryFactory, $fixtureFactory, $handlerFactory, $eventManager, $data, $dataSet, $persist);
     if (!isset($this->data['url_key']) && isset($this->data['name'])) {
         $this->data['url_key'] = trim(strtolower(preg_replace('#[^0-9a-z%]+#i', '-', $this->data['name'])), '-');
     }
 }
Exemplo n.º 3
0
 /**
  * Create data array for filling tabs (new fixture specification)
  *
  * @param InjectableFixture $fixture
  * @return array
  */
 private function getFixtureFieldsByTabs(InjectableFixture $fixture)
 {
     $tabs = [];
     $data = $fixture->getData();
     foreach ($data as $field => $value) {
         $attributes = $fixture->getDataFieldConfig($field);
         $attributes['value'] = $value;
         if (array_key_exists('group', $attributes) && $attributes['group'] !== null) {
             $tabs[$attributes['group']][$field] = $attributes;
         } elseif (!array_key_exists('group', $attributes)) {
             $this->unassignedFields[$field] = $attributes;
         }
     }
     return $tabs;
 }