Skip to content

Commit

Permalink
#221 - swapping data-provider data order to remove unused parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
Ocramius committed Jan 8, 2015
1 parent aa229e6 commit 7f12f69
Showing 1 changed file with 16 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -853,19 +853,17 @@ public function getPropertyAccessProxies()
*
* @param string $className
* @param string $propertyName
* @param string $expected
* @param mixed $expected
* @param string[] $proxyOptions
*/
public function testSkipProperties($className, $propertyName, $expected, $proxyOptions)
public function testSkipProperties($className, $propertyName, $proxyOptions, $expected)
{
$proxy = $this->generateProxy($className, $proxyOptions);
$ghostObject = $proxy::staticProxyConstructor(
function () use ($propertyName) {
$this->fail(sprintf('The Property "%s" was not expected to be lazy-loaded', $propertyName));
}
);
$proxy = $this->generateProxy($className, $proxyOptions);
$ghostObject = $proxy::staticProxyConstructor(function () use ($propertyName) {
$this->fail(sprintf('The Property "%s" was not expected to be lazy-loaded', $propertyName));
});

$property = new \ReflectionProperty($className, $propertyName);
$property = new ReflectionProperty($className, $propertyName);
$property->setAccessible(true);

$this->assertSame($expected, $property->getValue($ghostObject));
Expand All @@ -876,13 +874,11 @@ function () use ($propertyName) {
*
* @param string $className
* @param string $propertyName
* @param string $expected
* @param string[] $proxyOptions
*/
public function testSkippedPropertiesAreNotOverwrittenOnInitialization(
$className,
$propertyName,
$expected,
$proxyOptions
) {
$proxyName = $this->generateProxy($className, $proxyOptions);
Expand All @@ -893,7 +889,7 @@ public function testSkippedPropertiesAreNotOverwrittenOnInitialization(
return true;
});

$property = new \ReflectionProperty($className, $propertyName);
$property = new ReflectionProperty($className, $propertyName);

$property->setAccessible(true);

Expand All @@ -916,38 +912,38 @@ public function skipPropertiesFixture()
[
ClassWithPublicProperties::class,
'property9',
'property9',
[
'skippedProperties' => ["property9"]
]
],
'property9',
],
[
ClassWithProtectedProperties::class,
'property9',
'property9',
[
'skippedProperties' => ["\0*\0property9"]
]
],
'property9',
],
[
ClassWithPrivateProperties::class,
'property9',
'property9',
[
'skippedProperties' => [
"\0ProxyManagerTestAsset\\ClassWithPrivateProperties\0property9"
]
]
],
'property9',
],
[
ClassWithCollidingPrivateInheritedProperties::class,
'property0',
'childClassProperty0',
[
'skippedProperties' => [
"\0ProxyManagerTestAsset\\ClassWithCollidingPrivateInheritedProperties\0property0"
]
]
],
'childClassProperty0',
],
];
}
Expand Down

0 comments on commit 7f12f69

Please sign in to comment.