public function DefinitionDecoratorTest::testSetProperty

@dataProvider getPropertyTests

File

drupal/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/DefinitionDecoratorTest.php, line 29

Class

DefinitionDecoratorTest

Namespace

Symfony\Component\DependencyInjection\Tests

Code

public function testSetProperty($property, $changeKey) {
  $def = new DefinitionDecorator('foo');
  $getter = 'get' . ucfirst($property);
  $setter = 'set' . ucfirst($property);
  $this
    ->assertNull($def
    ->{$getter}());
  $this
    ->assertSame($def, $def
    ->{$setter}('foo'));
  $this
    ->assertEquals('foo', $def
    ->{$getter}());
  $this
    ->assertEquals(array(
    $changeKey => true,
  ), $def
    ->getChanges());
}