示例#1
0
 /**
  * {@inheritdoc}
  */
 public function getValue(ConfigurationEntry $entry)
 {
     return $entry->getDenormalizedValue();
 }
 public function testSetValue()
 {
     $handlerServiceId = 'bar_handler';
     $clientValue = 'foo bar baz';
     $convertedValue = 'converted foo bar baz';
     $handler = $this->createMock('Modera\\ConfigBundle\\Config\\HandlerInterface');
     $handler->expects($this->atLeastOnce())->method('convertToStorageValue')->with($this->equalTo($clientValue), $this->isInstanceOf(CE::clazz()))->will($this->returnValue($convertedValue));
     $container = $this->createMockContainer($handlerServiceId, $handler);
     $ce = new CE('bar_prop');
     $ce->setServerHandlerConfig(array('handler' => $handlerServiceId));
     $ce->init($container);
     $ce->setValue($clientValue);
     $this->assertEquals($convertedValue, $ce->getDenormalizedValue());
 }