Inheritance: implements Symfony\Component\Serializer\Normalizer\NormalizableInterface
 public function testConfig()
 {
     $property = new ProjectProperty();
     $property->setConfig('foo');
     $actual = array();
     $expected = array('foo' => 3);
     $config = $property->mergeConfig($actual, 3);
     $this->assertEquals($expected, $config);
     $property->setConfig('foo');
     $actual = array('foo' => 1);
     $expected = array('foo' => 3);
     $config = $property->mergeConfig($actual, 3);
     $this->assertEquals($expected, $config);
     $property->setConfig('foo.bar');
     $actual = array();
     $expected = array('foo' => array('bar' => 3));
     $config = $property->mergeConfig($actual, 3);
     $this->assertEquals($expected, $config);
     $property->setConfig('foo.bar');
     $actual = array('foo' => array('bar' => 2, 'baz' => 3));
     $expected = array('foo' => array('bar' => 3, 'baz' => 3));
     $config = $property->mergeConfig($actual, 3);
     $this->assertEquals($expected, $config);
 }
Exemplo n.º 2
0
 /**
  * Adds a property to the project.
  *
  * @param ProjectProperty $property a project's property
  *
  * @return Project
  */
 public function addProperty(ProjectProperty $property)
 {
     $this->properties[] = $property;
     $property->setProject($this);
     return $this;
 }