@@ -13,7 +13,6 @@ |
||
13 | 13 | */ |
14 | 14 | namespace Xpressengine\Widget; |
15 | 15 | |
16 | -use Closure; |
|
17 | 16 | use Exception; |
18 | 17 | use Illuminate\Contracts\Support\Renderable; |
19 | 18 | use Illuminate\Contracts\View\Factory; |
@@ -283,7 +283,6 @@ |
||
283 | 283 | |
284 | 284 | /** |
285 | 285 | * validateDBInfo |
286 | - |
|
287 | 286 | * @param $dbInfo |
288 | 287 | * |
289 | 288 | * @return bool |
@@ -67,6 +67,12 @@ |
||
67 | 67 | ]; |
68 | 68 | } |
69 | 69 | |
70 | + /** |
|
71 | + * @param string $siteKey |
|
72 | + * @param string $secret |
|
73 | + * @param m\MockInterface $request |
|
74 | + * @param m\MockInterface $frontend |
|
75 | + */ |
|
70 | 76 | private function createInstance($siteKey, $secret, $request, $frontend) |
71 | 77 | { |
72 | 78 | return new GoogleRecaptcha($siteKey, $secret, $request, $frontend); |
@@ -44,7 +44,7 @@ |
||
44 | 44 | } |
45 | 45 | |
46 | 46 | /** |
47 | - * @return m\MockInterface|\Xpressengine\Database\ProxyInterface |
|
47 | + * @return m\MockInterface |
|
48 | 48 | */ |
49 | 49 | private function getProxyInstance() |
50 | 50 | { |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | * |
67 | 67 | * @param mixed $object object |
68 | 68 | * @param string $propertyName method name |
69 | - * @param mixed $value parameters |
|
69 | + * @param integer $value parameters |
|
70 | 70 | * @return void |
71 | 71 | */ |
72 | 72 | private function setProperty(&$object, $propertyName, $value) |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | /** |
82 | 82 | * get connector |
83 | 83 | * |
84 | - * @return m\MockInterface|\Xpressengine\Database\VirtualConnection |
|
84 | + * @return m\MockInterface |
|
85 | 85 | */ |
86 | 86 | private function getConnector() |
87 | 87 | { |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | /** |
92 | 92 | * get connection |
93 | 93 | * |
94 | - * @return m\MockInterface|\Illuminate\Database\Connection |
|
94 | + * @return m\MockInterface |
|
95 | 95 | */ |
96 | 96 | private function getConnection() |
97 | 97 | { |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | /** |
102 | 102 | * get database coupler |
103 | 103 | * |
104 | - * @return m\MockInterface|\Xpressengine\Database\DatabaseCoupler |
|
104 | + * @return m\MockInterface |
|
105 | 105 | */ |
106 | 106 | private function getDatabaseCoupler() |
107 | 107 | { |
@@ -58,7 +58,7 @@ |
||
58 | 58 | /** |
59 | 59 | * get config entity |
60 | 60 | * |
61 | - * @return m\MockInterface|\Xpressengine\Config\ConfigEntity |
|
61 | + * @return m\MockInterface |
|
62 | 62 | */ |
63 | 63 | private function getConfigEntity() |
64 | 64 | { |
@@ -415,7 +415,7 @@ |
||
415 | 415 | $config = $this->getConfigEntity(); |
416 | 416 | $config->shouldReceive('get')->once()->with('required')->andReturn(false); |
417 | 417 | |
418 | - $result =$handler->getRules($config); |
|
418 | + $result = $handler->getRules($config); |
|
419 | 419 | $this->assertEquals([], $result); |
420 | 420 | |
421 | 421 | $config->shouldReceive('get')->with('id')->andReturn('id'); |
@@ -104,6 +104,10 @@ |
||
104 | 104 | |
105 | 105 | } |
106 | 106 | |
107 | + /** |
|
108 | + * @param AdvisorCollection $object |
|
109 | + * @param string $property |
|
110 | + */ |
|
107 | 111 | protected function getPropertyValue($object, $property) |
108 | 112 | { |
109 | 113 | $refl = new \ReflectionObject($object); |
@@ -33,14 +33,14 @@ discard block |
||
33 | 33 | public function testPutDuplicateAdvisorName() |
34 | 34 | { |
35 | 35 | $advisor1 = new Advisor( |
36 | - 'ad1', 'Xpressengine\Tests\Interception\Document@insertDocument', function ($target, $args) { |
|
36 | + 'ad1', 'Xpressengine\Tests\Interception\Document@insertDocument', function($target, $args) { |
|
37 | 37 | return $target($args); |
38 | 38 | } |
39 | 39 | ); |
40 | 40 | $this->advisorCollection->put($advisor1); |
41 | 41 | |
42 | 42 | $advisor2 = new Advisor( |
43 | - 'ad1', ['Xpressengine\Tests\Interception\Document@insertDocument', 'Xpressengine\Tests\Interception\Document@deleteDocument'], function ($target, $args) { |
|
43 | + 'ad1', ['Xpressengine\Tests\Interception\Document@insertDocument', 'Xpressengine\Tests\Interception\Document@deleteDocument'], function($target, $args) { |
|
44 | 44 | return $target($args); |
45 | 45 | } |
46 | 46 | ); |
@@ -52,14 +52,14 @@ discard block |
||
52 | 52 | { |
53 | 53 | |
54 | 54 | $advisor1 = new Advisor( |
55 | - 'ad1', 'Xpressengine\Tests\Interception\Document@insertDocument', function ($target, $args) { |
|
55 | + 'ad1', 'Xpressengine\Tests\Interception\Document@insertDocument', function($target, $args) { |
|
56 | 56 | return $target($args); |
57 | 57 | } |
58 | 58 | ); |
59 | 59 | $this->advisorCollection->put($advisor1); |
60 | 60 | |
61 | 61 | $advisor2 = new Advisor( |
62 | - 'ad2', ['Xpressengine\Tests\Interception\Document@insertDocument', 'Xpressengine\Tests\Interception\Document@deleteDocument'], function ($target, $args) { |
|
62 | + 'ad2', ['Xpressengine\Tests\Interception\Document@insertDocument', 'Xpressengine\Tests\Interception\Document@deleteDocument'], function($target, $args) { |
|
63 | 63 | return $target($args); |
64 | 64 | } |
65 | 65 | |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | $this->advisorCollection->put($advisor2, ['before' => ['ad1', 'ad3']]); |
68 | 68 | |
69 | 69 | $advisor3 = new Advisor( |
70 | - 'ad3', 'Xpressengine\Tests\Interception\Document@deleteDocument', function ($target, $args) { |
|
70 | + 'ad3', 'Xpressengine\Tests\Interception\Document@deleteDocument', function($target, $args) { |
|
71 | 71 | return $target($args); |
72 | 72 | }); |
73 | 73 | |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | { |
92 | 92 | |
93 | 93 | $advisor1 = new Advisor( |
94 | - 'ad1', 'Bar@insertDocument', function ($target, $args) { |
|
94 | + 'ad1', 'Bar@insertDocument', function($target, $args) { |
|
95 | 95 | return $target($args); |
96 | 96 | } |
97 | 97 | ); |
@@ -34,7 +34,6 @@ |
||
34 | 34 | /** |
35 | 35 | * getAdvisorList |
36 | 36 | * |
37 | - * @param null $proxyObject |
|
38 | 37 | * @param null $sortedList |
39 | 38 | * @param null $advisorArr |
40 | 39 | * |
@@ -1,7 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | namespace Xpressengine\Tests\Interception; |
3 | 3 | |
4 | -use Xpressengine\Interception\Advisor; |
|
5 | 4 | use Xpressengine\Interception\AdvisorList; |
6 | 5 | |
7 | 6 | class AdvisorListTest extends \PHPUnit_Framework_TestCase |
@@ -28,6 +28,9 @@ |
||
28 | 28 | $this->assertContains('Proxy_Dave_Dave extends Dave\\Dave', $code); |
29 | 29 | } |
30 | 30 | |
31 | + /** |
|
32 | + * @param string $string |
|
33 | + */ |
|
31 | 34 | private function getConfig($string) |
32 | 35 | { |
33 | 36 | $m = \Mockery::mock('\Xpressengine\Interception\Proxy\ProxyConfig'); |
@@ -32,13 +32,13 @@ |
||
32 | 32 | { |
33 | 33 | $m = \Mockery::mock('\Xpressengine\Interception\Proxy\ProxyConfig'); |
34 | 34 | $m->shouldReceive('getTargetName')->andReturnUsing( |
35 | - function () use ($string) { |
|
35 | + function() use ($string) { |
|
36 | 36 | return trim($string, '\\'); |
37 | 37 | } |
38 | 38 | ); |
39 | 39 | $m->shouldReceive('getProxyName')->andReturnUsing( |
40 | - function () use ($string) { |
|
41 | - return 'Proxy_' . str_replace('\\', '_', trim($string, '\\')); |
|
40 | + function() use ($string) { |
|
41 | + return 'Proxy_'.str_replace('\\', '_', trim($string, '\\')); |
|
42 | 42 | } |
43 | 43 | ); |
44 | 44 | return $m; |
@@ -69,6 +69,10 @@ |
||
69 | 69 | } |
70 | 70 | |
71 | 71 | |
72 | + /** |
|
73 | + * @param \Mockery\MockInterface $advisorCollection |
|
74 | + * @param \Mockery\MockInterface $generator |
|
75 | + */ |
|
72 | 76 | protected function getHandler($advisorCollection = null, $generator = null) |
73 | 77 | { |
74 | 78 |
@@ -4,9 +4,6 @@ |
||
4 | 4 | use Xpressengine\Interception\Advisor; |
5 | 5 | use Xpressengine\Interception\AdvisorCollection; |
6 | 6 | use Xpressengine\Interception\InterceptionHandler; |
7 | -use Xpressengine\Interception\Proxy\Loader\EvalLoader; |
|
8 | -use Xpressengine\Interception\Proxy\Loader\FileLoader; |
|
9 | -use Xpressengine\Interception\Proxy\Loader\Loader; |
|
10 | 7 | use Xpressengine\Interception\Proxy\ProxyGenerator; |
11 | 8 | |
12 | 9 | class InterceptionHandlerTest extends \PHPUnit_Framework_TestCase |
@@ -43,7 +43,7 @@ |
||
43 | 43 | $advisor = $interceptor->addAdvisor( |
44 | 44 | 'Xpressengine\Tests\Interception\Document@insertDocument', |
45 | 45 | 'spamfilter', |
46 | - function ($target, $args) { |
|
46 | + function($target, $args) { |
|
47 | 47 | return $target($args); |
48 | 48 | } |
49 | 49 | ); |