You are here

public function DefinitionDecoratorTest::testLegacySetProperty in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/dependency-injection/Tests/DefinitionDecoratorTest.php \Symfony\Component\DependencyInjection\Tests\DefinitionDecoratorTest::testLegacySetProperty()

@dataProvider provideLegacyPropertyTests @group legacy

File

vendor/symfony/dependency-injection/Tests/DefinitionDecoratorTest.php, line 56

Class

DefinitionDecoratorTest

Namespace

Symfony\Component\DependencyInjection\Tests

Code

public function testLegacySetProperty($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());
}