@@ -12,58 +12,58 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | class DataProviderTest extends \PHPUnit_Framework_TestCase |
| 14 | 14 | { |
| 15 | - public function testRunExecutePopulate() |
|
| 16 | - { |
|
| 17 | - $provider = $this->getMockForAbstractClass(DataProvider::class); |
|
| 15 | + public function testRunExecutePopulate() |
|
| 16 | + { |
|
| 17 | + $provider = $this->getMockForAbstractClass(DataProvider::class); |
|
| 18 | 18 | |
| 19 | - $provider |
|
| 20 | - ->expects($this->once()) |
|
| 21 | - ->method('populate') |
|
| 22 | - ; |
|
| 19 | + $provider |
|
| 20 | + ->expects($this->once()) |
|
| 21 | + ->method('populate') |
|
| 22 | + ; |
|
| 23 | 23 | |
| 24 | - $provider->run($this->getClient(), 'index', 'type'); |
|
| 25 | - } |
|
| 24 | + $provider->run($this->getClient(), 'index', 'type'); |
|
| 25 | + } |
|
| 26 | 26 | |
| 27 | - private function getClient() |
|
| 28 | - { |
|
| 29 | - return $this |
|
| 30 | - ->getMockBuilder(Client::class) |
|
| 31 | - ->disableOriginalConstructor() |
|
| 32 | - ->getMock() |
|
| 33 | - ; |
|
| 34 | - } |
|
| 27 | + private function getClient() |
|
| 28 | + { |
|
| 29 | + return $this |
|
| 30 | + ->getMockBuilder(Client::class) |
|
| 31 | + ->disableOriginalConstructor() |
|
| 32 | + ->getMock() |
|
| 33 | + ; |
|
| 34 | + } |
|
| 35 | 35 | |
| 36 | - public function testIndexWithIndexAndType() |
|
| 37 | - { |
|
| 38 | - $provider = $this->getMockForAbstractClass(DataProvider::class); |
|
| 36 | + public function testIndexWithIndexAndType() |
|
| 37 | + { |
|
| 38 | + $provider = $this->getMockForAbstractClass(DataProvider::class); |
|
| 39 | 39 | |
| 40 | - $client = $this->getClient(); |
|
| 41 | - $client |
|
| 42 | - ->expects($this->once()) |
|
| 43 | - ->method('index') |
|
| 44 | - ->with([ |
|
| 40 | + $client = $this->getClient(); |
|
| 41 | + $client |
|
| 42 | + ->expects($this->once()) |
|
| 43 | + ->method('index') |
|
| 44 | + ->with([ |
|
| 45 | 45 | 'index' => 'my_index', |
| 46 | 46 | 'type' => 'my_type', |
| 47 | 47 | 'id' => 'my_id', |
| 48 | 48 | 'body' => ['foo' => 'bar'], |
| 49 | - ]) |
|
| 50 | - ; |
|
| 49 | + ]) |
|
| 50 | + ; |
|
| 51 | 51 | |
| 52 | - $provider |
|
| 53 | - ->expects($this->once()) |
|
| 54 | - ->method('populate') |
|
| 55 | - ->will( |
|
| 52 | + $provider |
|
| 53 | + ->expects($this->once()) |
|
| 54 | + ->method('populate') |
|
| 55 | + ->will( |
|
| 56 | 56 | $this->returnCallback( |
| 57 | - function () use ($provider) { |
|
| 58 | - $provider->index( |
|
| 59 | - 'my_id', |
|
| 60 | - ['foo' => 'bar'] |
|
| 61 | - ); |
|
| 62 | - } |
|
| 57 | + function () use ($provider) { |
|
| 58 | + $provider->index( |
|
| 59 | + 'my_id', |
|
| 60 | + ['foo' => 'bar'] |
|
| 61 | + ); |
|
| 62 | + } |
|
| 63 | 63 | ) |
| 64 | - ) |
|
| 65 | - ; |
|
| 64 | + ) |
|
| 65 | + ; |
|
| 66 | 66 | |
| 67 | - $provider->run($client, 'my_index', 'my_type'); |
|
| 68 | - } |
|
| 67 | + $provider->run($client, 'my_index', 'my_type'); |
|
| 68 | + } |
|
| 69 | 69 | } |
| 70 | 70 | \ No newline at end of file |
@@ -54,7 +54,7 @@ |
||
| 54 | 54 | ->method('populate') |
| 55 | 55 | ->will( |
| 56 | 56 | $this->returnCallback( |
| 57 | - function () use ($provider) { |
|
| 57 | + function() use ($provider) { |
|
| 58 | 58 | $provider->index( |
| 59 | 59 | 'my_id', |
| 60 | 60 | ['foo' => 'bar'] |
@@ -92,7 +92,7 @@ |
||
| 92 | 92 | |
| 93 | 93 | private function registerProvider($registry, $providerId, $tag) |
| 94 | 94 | { |
| 95 | - $registry->addMethodCall('addProvider', [ |
|
| 95 | + $registry->addMethodCall('addProvider', [ |
|
| 96 | 96 | new Reference($providerId), |
| 97 | 97 | $tag['index'], |
| 98 | 98 | $tag['type'] |
@@ -73,7 +73,7 @@ |
||
| 73 | 73 | { |
| 74 | 74 | if ($this->isTagIncorrect($tag)) { |
| 75 | 75 | throw new \InvalidArgumentException( |
| 76 | - sprintf('DataProvider "%s" must specify the "index"'. |
|
| 76 | + sprintf('DataProvider "%s" must specify the "index"' . |
|
| 77 | 77 | ' and "type" attribute.', |
| 78 | 78 | $providerId |
| 79 | 79 | ) |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | { |
| 52 | 52 | return array_filter( |
| 53 | 53 | $this->providers, |
| 54 | - function ($providerData) use ($index, $type) { |
|
| 54 | + function($providerData) use ($index, $type) { |
|
| 55 | 55 | return $this->match($providerData, $index, $type); |
| 56 | 56 | } |
| 57 | 57 | ); |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | private function mapProviders(array $providers) |
| 70 | 70 | { |
| 71 | 71 | return array_map( |
| 72 | - function ($providerData) { |
|
| 72 | + function($providerData) { |
|
| 73 | 73 | return $providerData['provider']; |
| 74 | 74 | }, |
| 75 | 75 | $providers |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | |
| 25 | 25 | $loader = new Loader\YamlFileLoader( |
| 26 | 26 | $container, |
| 27 | - new FileLocator(__DIR__.'/../Resources/config') |
|
| 27 | + new FileLocator(__DIR__ . '/../Resources/config') |
|
| 28 | 28 | ); |
| 29 | 29 | |
| 30 | 30 | $loader->load('services.yml'); |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | { |
| 32 | 32 | $providers = $this->registry->getProviders($index, $type); |
| 33 | 33 | |
| 34 | - foreach($providers as $provider) { |
|
| 34 | + foreach ($providers as $provider) { |
|
| 35 | 35 | $provider->run($client, $index, $type); |
| 36 | 36 | } |
| 37 | 37 | } |