/**
  * @param boolean $isLinkedToSite
  * @param string  $value
  *
  * @dataProvider provideLinkedToSiteAndValue
  */
 public function testPreUpdateWithNoExistingAttributes($isLinkedToSite, $value)
 {
     $attribute = Phake::mock('OpenOrchestra\\ModelInterface\\Model\\ContentAttributeInterface');
     Phake::when($attribute)->getValue()->thenReturn($value);
     $content = Phake::mock('OpenOrchestra\\ModelInterface\\Model\\ContentInterface');
     Phake::when($content)->isLinkedToSite()->thenReturn($isLinkedToSite);
     Phake::when($content)->getAttributeByName($this->fieldId)->thenReturn($attribute);
     Phake::when($this->event)->getDocument()->thenReturn($content);
     $contentDocument = new Content();
     Phake::when($this->contentRepository)->findByContentId(Phake::anyParameters())->thenReturn(array($contentDocument));
     $this->listener->preUpdate($this->event);
     $this->assertSame($isLinkedToSite, $contentDocument->isLinkedToSite());
     $field = $contentDocument->getAttributeByName($this->fieldId);
     $this->assertInstanceOf('OpenOrchestra\\ModelInterface\\Model\\ContentAttributeInterface', $field);
     $this->assertSame($value, $field->getValue());
     $this->assertSame($this->fieldId, $field->getName());
     Phake::verify($this->documentManager)->flush($contentDocument);
 }