@@ -47,7 +47,7 @@ |
||
47 | 47 | * @param UserInterface $user |
48 | 48 | * @param array $data |
49 | 49 | * |
50 | - * @return EmailInterface |
|
50 | + * @return \Xpressengine\Database\Eloquent\DynamicModel |
|
51 | 51 | */ |
52 | 52 | public function create(UserInterface $user, array $data) |
53 | 53 | { |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | * @param UserInterface $user |
47 | 47 | * @param array $data |
48 | 48 | * |
49 | - * @return AccountInterface |
|
49 | + * @return \Xpressengine\Database\Eloquent\DynamicModel |
|
50 | 50 | */ |
51 | 51 | public function create(UserInterface $user, array $data) |
52 | 52 | { |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | * |
61 | 61 | * @param string $userId user id |
62 | 62 | * |
63 | - * @return array |
|
63 | + * @return \Illuminate\Database\Eloquent\Collection |
|
64 | 64 | */ |
65 | 65 | public function findByUserId($userId) |
66 | 66 | { |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | * @param UserInterface $user |
48 | 48 | * @param array $data |
49 | 49 | * |
50 | - * @return EmailInterface |
|
50 | + * @return \Xpressengine\Database\Eloquent\DynamicModel |
|
51 | 51 | */ |
52 | 52 | public function create(UserInterface $user, array $data) |
53 | 53 | { |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | * |
92 | 92 | * @param $userId |
93 | 93 | * |
94 | - * @return EmailInterface[] |
|
94 | + * @return \Illuminate\Database\Eloquent\Collection |
|
95 | 95 | */ |
96 | 96 | public function findByUserId($userId) |
97 | 97 | { |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | * |
45 | 45 | * @param array $data |
46 | 46 | * |
47 | - * @return UserInterface |
|
47 | + * @return \Xpressengine\Database\Eloquent\DynamicModel |
|
48 | 48 | */ |
49 | 49 | public function create(array $data) |
50 | 50 | { |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | * @param string $emailPrefix 조회할 이메일의 이름영역 |
104 | 104 | * @param string[]|null $with 함께 반환할 relation 정보 |
105 | 105 | * |
106 | - * @return UserInterface[] |
|
106 | + * @return \Illuminate\Database\Eloquent\Collection |
|
107 | 107 | */ |
108 | 108 | public function searchByEmailPrefix($emailPrefix, $with = null) |
109 | 109 | { |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | { |
79 | 79 | $user = $this->query()->whereHas( |
80 | 80 | 'emails', |
81 | - function ($q) use ($address) { |
|
81 | + function($q) use ($address) { |
|
82 | 82 | $q->where('address', $address); |
83 | 83 | } |
84 | 84 | )->first(); |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | { |
99 | 99 | $users = $this->query()->whereHas( |
100 | 100 | 'emails', |
101 | - function ($q) use ($emailPrefix) { |
|
101 | + function($q) use ($emailPrefix) { |
|
102 | 102 | $q->where('address', 'like', $emailPrefix.'@%'); |
103 | 103 | } |
104 | 104 | )->get(); |
@@ -315,6 +315,9 @@ |
||
315 | 315 | ]; |
316 | 316 | } |
317 | 317 | |
318 | + /** |
|
319 | + * @param string $methodName |
|
320 | + */ |
|
318 | 321 | private function invokeMethod(&$object, $methodName, array $parameters = array()) |
319 | 322 | { |
320 | 323 | $reflection = new \ReflectionClass(get_class($object)); |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | ->shouldAllowMockingProtectedMethods(); |
70 | 70 | |
71 | 71 | $instance->shouldReceive('find')->once()->with('plugin.dummy', 'default')->andReturnNull(); |
72 | - $instance->shouldReceive('setAncestor')->once()->with(m::on(function ($permission) { |
|
72 | + $instance->shouldReceive('setAncestor')->once()->with(m::on(function($permission) { |
|
73 | 73 | return $permission instanceof Permission; |
74 | 74 | })); |
75 | 75 | |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | |
96 | 96 | $repo->shouldReceive('findByName')->once()->with('default', 'plugin.dummy')->andReturnNull(); |
97 | 97 | $repo->shouldReceive('fetchAncestor')->once()->andReturn([$mockParent]); |
98 | - $repo->shouldReceive('insert')->once()->with(m::on(function ($value) { |
|
98 | + $repo->shouldReceive('insert')->once()->with(m::on(function($value) { |
|
99 | 99 | return $value instanceof Permission; |
100 | 100 | }))->andReturn($mockPermission); |
101 | 101 |
@@ -57,11 +57,21 @@ |
||
57 | 57 | |
58 | 58 | class SamplePolicy extends Policy |
59 | 59 | { |
60 | + /** |
|
61 | + * @param m\MockInterface $user |
|
62 | + * @param string $name |
|
63 | + * @param string $siteKey |
|
64 | + */ |
|
60 | 65 | public function update($user, $name, $siteKey) |
61 | 66 | { |
62 | 67 | return $this->check($user, $this->get($name, $siteKey), 'update'); |
63 | 68 | } |
64 | 69 | |
70 | + /** |
|
71 | + * @param m\MockInterface $user |
|
72 | + * @param string $name |
|
73 | + * @param string $siteKey |
|
74 | + */ |
|
65 | 75 | public function read($user, $name, $siteKey) |
66 | 76 | { |
67 | 77 | return $this->check($user, $this->get($name, $siteKey), 'read'); |
@@ -315,6 +315,9 @@ |
||
315 | 315 | ]; |
316 | 316 | } |
317 | 317 | |
318 | + /** |
|
319 | + * @param string $methodName |
|
320 | + */ |
|
318 | 321 | private function invokeMethod(&$object, $methodName, array $parameters = array()) |
319 | 322 | { |
320 | 323 | $reflection = new \ReflectionClass(get_class($object)); |
@@ -15,7 +15,6 @@ |
||
15 | 15 | namespace Xpressengine\Tests\Menu; |
16 | 16 | |
17 | 17 | use PHPUnit_Framework_TestCase; |
18 | -use Mockery as m; |
|
19 | 18 | use Xpressengine\Menu\MenuType\DirectLink; |
20 | 19 | |
21 | 20 | /** |
@@ -2,12 +2,9 @@ |
||
2 | 2 | |
3 | 3 | use PHPUnit_Framework_TestCase; |
4 | 4 | use Mockery as m; |
5 | -use Xpressengine\Routing\InstanceRoute; |
|
6 | -use Xpressengine\Routing\InstanceRouteHandler; |
|
7 | 5 | use Xpressengine\Routing\ModuleValidator; |
8 | 6 | use Illuminate\Routing\Route; |
9 | 7 | use Illuminate\Http\Request; |
10 | -use Xpressengine\Routing\RouteCollection; |
|
11 | 8 | |
12 | 9 | /** |
13 | 10 | * Class ModuleValidatorTest |