function it_normalizes_family($transnormalizer, $family, AttributeInterface $name, AttributeInterface $price, AttributeRequirement $ecommercereq, AttributeRequirement $mobilereq, ChannelInterface $ecommerce, ChannelInterface $mobile)
 {
     $transnormalizer->normalize(Argument::cetera())->willReturn([]);
     $family->getCode()->willReturn('mugs');
     $family->getAttributes()->willReturn([$name, $price]);
     $name->getCode()->willReturn('name');
     $price->getCode()->willReturn('price');
     $family->getAttributeAsLabel()->willReturn($name);
     $family->getAttributeRequirements()->willReturn([$ecommercereq, $mobilereq]);
     $ecommercereq->getChannel()->willReturn($ecommerce);
     $mobilereq->getChannel()->willReturn($mobile);
     $ecommercereq->isRequired()->willReturn(true);
     $mobilereq->isRequired()->willReturn(false);
     $ecommerce->getCode()->willReturn('ecommerce');
     $mobile->getCode()->willReturn('mobile');
     $ecommercereq->getAttribute()->willReturn($name);
     $result = $this->normalize($family)->shouldReturn(['code' => 'mugs', 'attributes' => 'name,price', 'attributeAsLabel' => 'name', 'requirements' => 'ecommerce:name|mobile:']);
 }
 /**
  * {@inheritDoc}
  */
 public function getChannel()
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'getChannel', array());
     return parent::getChannel();
 }
 /**
  * Adds a requirement to the completenesses
  *
  * @param array                &$completenesses
  * @param AttributeRequirement $requirement
  * @param ArrayCollection      $productValues
  * @param array                $localeCodes
  */
 protected function addRequirementToCompleteness(array &$completenesses, AttributeRequirement $requirement, ArrayCollection $productValues, array $localeCodes)
 {
     $attribute = $requirement->getAttribute();
     $channel = $requirement->getChannel();
     foreach ($localeCodes as $localeCode) {
         $constraint = new ProductValueComplete(array('channel' => $channel));
         $valueCode = $this->getValueCode($attribute, $localeCode, $channel->getCode());
         $missing = false;
         if (!isset($productValues[$valueCode])) {
             $missing = true;
         } elseif ($this->validator->validateValue($productValues[$valueCode], $constraint)->count()) {
             $missing = true;
         }
         if ($missing) {
             $completenesses[$localeCode][$channel->getCode()]['missing'][] = $attribute;
         }
     }
 }