write() public method

public write ( PHPCR\NodeInterface $node, Sulu\Component\Content\Compat\PropertyInterface $property, $userId, $webspaceKey, $languageCode, $segmentKey )
$node PHPCR\NodeInterface
$property Sulu\Component\Content\Compat\PropertyInterface
 public function testWriteWithPassedContainer()
 {
     $node = $this->getMockForAbstractClass('Sulu\\Bundle\\MediaBundle\\Tests\\Unit\\Content\\Types\\NodeInterface', [], '', true, true, true, ['setProperty']);
     $property = $this->getMockForAbstractClass('Sulu\\Component\\Content\\Compat\\PropertyInterface', [], '', true, true, true, ['getValue', 'getParams']);
     $property->expects($this->any())->method('getName')->will($this->returnValue('property'));
     $property->expects($this->any())->method('getValue')->will($this->returnValue(['ids' => [1, 2, 3, 4], 'displayOption' => 'right', 'config' => ['conf1' => 1, 'conf2' => 2], 'data' => ['data1', 'data2']]));
     $property->expects($this->any())->method('getParams')->will($this->returnValue([]));
     $node->expects($this->once())->method('setProperty')->with('property', json_encode(['ids' => [1, 2, 3, 4], 'displayOption' => 'right', 'config' => ['conf1' => 1, 'conf2' => 2]]));
     $this->mediaSelection->write($node, $property, 0, 'test', 'en', 's');
 }