Skip to content
This repository has been archived by the owner on Feb 6, 2020. It is now read-only.

Commit

Permalink
Reverted the php array notation changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
macnibblet authored and Ocramius committed Nov 19, 2014
1 parent cb19a06 commit 1984c66
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions test/AbstractPluginManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,26 +27,26 @@ class AbstractPluginManagerTest extends \PHPUnit_Framework_TestCase
public function setup()
{
$this->serviceManager = new ServiceManager;
$this->pluginManager = new FooPluginManager(new Config([
'factories' => [
$this->pluginManager = new FooPluginManager(new Config(array(
'factories' => array(
'Foo' => 'ZendTest\ServiceManager\TestAsset\FooFactory',
],
'shared' => [
),
'shared' => array(
'Foo' => false,
],
]));
),
)));
}

public function testSetMultipleCreationOptions()
{
$pluginManager = new FooPluginManager(new Config([
'factories' => [
$pluginManager = new FooPluginManager(new Config(array(
'factories' => array(
'Foo' => 'ZendTest\ServiceManager\TestAsset\FooFactory'
],
'shared' => [
),
'shared' => array(
'Foo' => false
]
]));
)
)));

$refl = new ReflectionClass($pluginManager);
$reflProperty = $refl->getProperty('factories');
Expand All @@ -55,17 +55,17 @@ public function testSetMultipleCreationOptions()
$value = $reflProperty->getValue($pluginManager);
$this->assertInternalType('string', $value['foo']);

$pluginManager->get('Foo', ['key1' => 'value1']);
$pluginManager->get('Foo', array('key1' => 'value1'));

$value = $reflProperty->getValue($pluginManager);
$this->assertInstanceOf('ZendTest\ServiceManager\TestAsset\FooFactory', $value['foo']);
$this->assertEquals(['key1' => 'value1'], $value['foo']->getCreationOptions());
$this->assertEquals(array('key1' => 'value1'), $value['foo']->getCreationOptions());

$pluginManager->get('Foo', ['key2' => 'value2']);
$pluginManager->get('Foo', array('key2' => 'value2'));

$value = $reflProperty->getValue($pluginManager);
$this->assertInstanceOf('ZendTest\ServiceManager\TestAsset\FooFactory', $value['foo']);
$this->assertEquals(['key2' => 'value2'], $value['foo']->getCreationOptions());
$this->assertEquals(array('key2' => 'value2'), $value['foo']->getCreationOptions());
}

/**
Expand All @@ -82,9 +82,9 @@ public function testGetFaultyRegisteredInvokableThrowsException()

public function testAbstractFactoryWithMutableCreationOptions()
{
$creationOptions = ['key1' => 'value1'];
$creationOptions = array('key1' => 'value1');
$mock = 'ZendTest\ServiceManager\TestAsset\AbstractFactoryWithMutableCreationOptions';
$abstractFactory = $this->getMock($mock, ['setCreationOptions']);
$abstractFactory = $this->getMock($mock, array('setCreationOptions'));
$abstractFactory->expects($this->once())
->method('setCreationOptions')
->with($creationOptions);
Expand All @@ -97,7 +97,7 @@ public function testAbstractFactoryWithMutableCreationOptions()
public function testMutableMethodNeverCalledWithoutCreationOptions()
{
$mock = 'ZendTest\ServiceManager\TestAsset\CallableWithMutableCreationOptions';
$callable = $this->getMock($mock, ['setCreationOptions']);
$callable = $this->getMock($mock, array('setCreationOptions'));
$callable->expects($this->never())
->method('setCreationOptions');

Expand All @@ -110,9 +110,9 @@ public function testMutableMethodNeverCalledWithoutCreationOptions()

public function testCallableObjectWithMutableCreationOptions()
{
$creationOptions = ['key1' => 'value1'];
$creationOptions = array('key1' => 'value1');
$mock = 'ZendTest\ServiceManager\TestAsset\CallableWithMutableCreationOptions';
$callable = $this->getMock($mock, ['setCreationOptions']);
$callable = $this->getMock($mock, array('setCreationOptions'));
$callable->expects($this->once())
->method('setCreationOptions')
->with($creationOptions);
Expand Down Expand Up @@ -147,8 +147,8 @@ public function testSingleDelegatorUsage()
{
$delegatorFactory = $this->getMock('Zend\\ServiceManager\\DelegatorFactoryInterface');
$pluginManager = $this->getMockForAbstractClass('Zend\ServiceManager\AbstractPluginManager');
$realService = $this->getMock('stdClass', [], [], 'RealService');
$delegator = $this->getMock('stdClass', [], [], 'Delegator');
$realService = $this->getMock('stdClass', array(), array(), 'RealService');
$delegator = $this->getMock('stdClass', array(), array(), 'Delegator');

$delegatorFactory
->expects($this->once())
Expand Down

0 comments on commit 1984c66

Please sign in to comment.