@@ -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'] |
@@ -13,68 +13,68 @@ |
||
13 | 13 | */ |
14 | 14 | class DataProviderTest extends \PHPUnit_Framework_TestCase |
15 | 15 | { |
16 | - public function testRunExecutePopulate() |
|
17 | - { |
|
18 | - $provider = $this->getMockForAbstractClass(DataProvider::class); |
|
16 | + public function testRunExecutePopulate() |
|
17 | + { |
|
18 | + $provider = $this->getMockForAbstractClass(DataProvider::class); |
|
19 | 19 | |
20 | - $provider |
|
21 | - ->expects($this->once()) |
|
22 | - ->method('populate') |
|
23 | - ; |
|
20 | + $provider |
|
21 | + ->expects($this->once()) |
|
22 | + ->method('populate') |
|
23 | + ; |
|
24 | 24 | |
25 | - $provider->run( |
|
26 | - $this->getClient(), |
|
27 | - 'index', |
|
28 | - 'type', |
|
29 | - $this->getMock(EventDispatcherInterface::class) |
|
30 | - ); |
|
31 | - } |
|
25 | + $provider->run( |
|
26 | + $this->getClient(), |
|
27 | + 'index', |
|
28 | + 'type', |
|
29 | + $this->getMock(EventDispatcherInterface::class) |
|
30 | + ); |
|
31 | + } |
|
32 | 32 | |
33 | - private function getClient() |
|
34 | - { |
|
35 | - return $this |
|
36 | - ->getMockBuilder(Client::class) |
|
37 | - ->disableOriginalConstructor() |
|
38 | - ->getMock() |
|
39 | - ; |
|
40 | - } |
|
33 | + private function getClient() |
|
34 | + { |
|
35 | + return $this |
|
36 | + ->getMockBuilder(Client::class) |
|
37 | + ->disableOriginalConstructor() |
|
38 | + ->getMock() |
|
39 | + ; |
|
40 | + } |
|
41 | 41 | |
42 | - public function testIndexWithIndexAndType() |
|
43 | - { |
|
44 | - $provider = $this->getMockForAbstractClass(DataProvider::class); |
|
42 | + public function testIndexWithIndexAndType() |
|
43 | + { |
|
44 | + $provider = $this->getMockForAbstractClass(DataProvider::class); |
|
45 | 45 | |
46 | - $client = $this->getClient(); |
|
47 | - $client |
|
48 | - ->expects($this->once()) |
|
49 | - ->method('index') |
|
50 | - ->with([ |
|
46 | + $client = $this->getClient(); |
|
47 | + $client |
|
48 | + ->expects($this->once()) |
|
49 | + ->method('index') |
|
50 | + ->with([ |
|
51 | 51 | 'index' => 'my_index', |
52 | 52 | 'type' => 'my_type', |
53 | 53 | 'id' => 'my_id', |
54 | 54 | 'body' => ['foo' => 'bar'], |
55 | - ]) |
|
56 | - ; |
|
55 | + ]) |
|
56 | + ; |
|
57 | 57 | |
58 | - $provider |
|
59 | - ->expects($this->once()) |
|
60 | - ->method('populate') |
|
61 | - ->will( |
|
58 | + $provider |
|
59 | + ->expects($this->once()) |
|
60 | + ->method('populate') |
|
61 | + ->will( |
|
62 | 62 | $this->returnCallback( |
63 | - function () use ($provider) { |
|
64 | - $provider->index( |
|
65 | - 'my_id', |
|
66 | - ['foo' => 'bar'] |
|
67 | - ); |
|
68 | - } |
|
63 | + function () use ($provider) { |
|
64 | + $provider->index( |
|
65 | + 'my_id', |
|
66 | + ['foo' => 'bar'] |
|
67 | + ); |
|
68 | + } |
|
69 | 69 | ) |
70 | - ) |
|
71 | - ; |
|
70 | + ) |
|
71 | + ; |
|
72 | 72 | |
73 | - $provider->run( |
|
74 | - $client, |
|
75 | - 'my_index', |
|
76 | - 'my_type', |
|
77 | - $this->getMock(EventDispatcherInterface::class) |
|
78 | - ); |
|
79 | - } |
|
73 | + $provider->run( |
|
74 | + $client, |
|
75 | + 'my_index', |
|
76 | + 'my_type', |
|
77 | + $this->getMock(EventDispatcherInterface::class) |
|
78 | + ); |
|
79 | + } |
|
80 | 80 | } |
81 | 81 | \ No newline at end of file |
@@ -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 | ) |
@@ -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'); |
@@ -39,7 +39,7 @@ |
||
39 | 39 | |
40 | 40 | public function testMatch() |
41 | 41 | { |
42 | - $testedInstance = new RegistryEntry( |
|
42 | + $testedInstance = new RegistryEntry( |
|
43 | 43 | $this->getMock(DataProviderInterface::class), |
44 | 44 | 'my_index', |
45 | 45 | 'my_type' |
@@ -31,7 +31,7 @@ |
||
31 | 31 | { |
32 | 32 | $entries = $this->registry->get($index, $type); |
33 | 33 | |
34 | - foreach($entries as $entry) { |
|
34 | + foreach ($entries as $entry) { |
|
35 | 35 | $entry->getProvider()->run( |
36 | 36 | $client, |
37 | 37 | $entry->getIndex(), |
@@ -38,7 +38,7 @@ |
||
38 | 38 | { |
39 | 39 | return array_filter( |
40 | 40 | $this->entries, |
41 | - function ($entry) use ($index, $type) { |
|
41 | + function($entry) use ($index, $type) { |
|
42 | 42 | return $entry->match($index, $type); |
43 | 43 | } |
44 | 44 | ); |