-
-
Notifications
You must be signed in to change notification settings - Fork 190
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
Skip properties when use ghost objects #221
Skip properties when use ghost objects #221
Conversation
$properties | ||
); | ||
|
||
$ghostObject->$propertyName; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This access will fail for private/protected properties. Also, you should assert on the value of the property once retrieved
c0e6455
to
7d76711
Compare
$publicProperties = new PublicPropertiesMap($originalClass); | ||
$privateProperties = new PrivatePropertiesMap($originalClass); | ||
$publicProperties = new PublicPropertiesMap($originalClass, $properties); | ||
$privateProperties = new PrivatePropertiesMap($originalClass, $properties); | ||
$protectedProperties = new ProtectedPropertiesMap($originalClass); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not filtered?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Ocramius not because, I'm trying to make public and private pass first. But don't happens :'(
@@ -36,6 +37,13 @@ class LazyLoadingGhostFactory extends AbstractLazyFactory | |||
*/ | |||
private $generator; | |||
|
|||
public function createProxy($className, Closure $initializer, array $properties = []) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can probably be removed: $properties
can go to the parent class IMO
$this->assertArrayNotHasKey($propertyName, $filteredProperties->$methodToGetProperties()); | ||
} | ||
|
||
public function propertiesToSkipFixture() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't mix data providers and test methods. Move the data-provider to the bottom
6cdb6e1
to
2a7d5cf
Compare
new ReflectionClass(ClassWithMixedProperties::class) | ||
); | ||
|
||
$this->assertArrayHasKey($propertyName, $properties->$methodToGetProperties()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this simply be re-designed to use getInstanceProperties()
? I don't like the dynamic method call here :-)
…oading-ghost-should-return-boolean Hotfix: call initializer on lazy loading ghost should return boolean result
@malukenho merged, thanks! |
#212