8000 [PropertyAccess] stop overwriting once a reference is reached (3rd) by bananer · Pull Request #13835 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[PropertyAccess] stop overwriting once a reference is reached (3rd) #13835

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
[PropertyAccess] add test case for property with only getter, no setter
  • Loading branch information
bananer committed Mar 2, 2015
commit b95ffd1e5350932490a5c27472a8f499137a96d4
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class TestClass
private $publicAccessorWithMoreRequiredParameters;
private $publicIsAccessor;
private $publicHasAccessor;
private $publicGetter;

public function __construct($value)
{
Expand All @@ -37,6 +38,7 @@ public function __construct($value)
$this->publicAccessorWithMoreRequiredParameters = $value;
$this->publicIsAccessor = $value;
$this->publicHasAccessor = $value;
$this->publicGetter = $value;
}

public function setPublicAccessor($value)
Expand Down Expand Up @@ -166,4 +168,8 @@ private function hasPrivateHasAccessor()
{
return 'foobar';
}

public function getPublicGetter() {
return $this->publicGetter;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -430,4 +430,12 @@ public function testTicket5755()

$this->assertEquals('foobar', $object->getProperty());
}

public function testPublicGetter()
{
$this->propertyAccessor = new PropertyAccessor(true);

$this->assertTrue($this->propertyAccessor->isReadable(new TestClass('foo'), 'publicGetter'));
$this->assertEquals('foo', $this->propertyAccessor->getValue(new TestClass('foo'), 'publicGetter'));
}
}
0