|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/* |
|
4
|
|
|
* This file is part of the core-bundle package. |
|
5
|
|
|
* |
|
6
|
|
|
* (c) 2018 WEBEWEB |
|
7
|
|
|
* |
|
8
|
|
|
* For the full copyright and license information, please view the LICENSE |
|
9
|
|
|
* file that was distributed with this source code. |
|
10
|
|
|
*/ |
|
11
|
|
|
|
|
12
|
|
|
namespace WBW\Bundle\CoreBundle\Tests\Fixtures\Controller; |
|
13
|
|
|
|
|
14
|
|
|
use Doctrine\ORM\EntityManagerInterface; |
|
15
|
|
|
use Psr\Container\ContainerInterface; |
|
16
|
|
|
use Psr\Log\LoggerInterface; |
|
17
|
|
|
use Symfony\Component\EventDispatcher\EventDispatcherInterface; |
|
18
|
|
|
use Symfony\Component\HttpFoundation\Session\SessionInterface; |
|
19
|
|
|
use Symfony\Component\Mailer\MailerInterface; |
|
20
|
|
|
use Symfony\Component\Routing\RouterInterface; |
|
21
|
|
|
use Symfony\Contracts\Translation\TranslatorInterface; |
|
22
|
|
|
use Twig\Environment; |
|
23
|
|
|
use WBW\Bundle\CoreBundle\Controller\AbstractController; |
|
24
|
|
|
use WBW\Bundle\CoreBundle\Event\NotificationEvent; |
|
25
|
|
|
use WBW\Bundle\CoreBundle\Event\ToastEvent; |
|
26
|
|
|
use WBW\Bundle\CoreBundle\EventListener\KernelEventListener; |
|
27
|
|
|
use WBW\Library\Symfony\Assets\NotificationInterface; |
|
28
|
|
|
use WBW\Library\Symfony\Assets\ToastInterface; |
|
29
|
|
|
use WBW\Library\Symfony\Response\DefaultJsonResponseDataInterface; |
|
30
|
|
|
|
|
31
|
|
|
/** |
|
32
|
|
|
* Test abstract controller. |
|
33
|
|
|
* |
|
34
|
|
|
* @author webeweb <https://github.com/webeweb> |
|
35
|
|
|
* @package WBW\Bundle\CoreBundle\Tests\Fixtures\Controller |
|
36
|
|
|
*/ |
|
37
|
|
|
class TestAbstractController extends AbstractController { |
|
38
|
|
|
|
|
39
|
|
|
/** |
|
40
|
|
|
* {@inheritDoc} |
|
41
|
|
|
*/ |
|
42
|
|
|
public function getContainer(): ?ContainerInterface { |
|
43
|
|
|
return parent::getContainer(); |
|
44
|
|
|
} |
|
45
|
|
|
|
|
46
|
|
|
/** |
|
47
|
|
|
* {@inheritDoc} |
|
48
|
|
|
*/ |
|
49
|
|
|
public function getEntityManager(): ?EntityManagerInterface { |
|
50
|
|
|
return parent::getEntityManager(); |
|
51
|
|
|
} |
|
52
|
|
|
|
|
53
|
|
|
/** |
|
54
|
|
|
* {@inheritDoc} |
|
55
|
|
|
*/ |
|
56
|
|
|
public function getEventDispatcher(): ?EventDispatcherInterface { |
|
57
|
|
|
return parent::getEventDispatcher(); |
|
58
|
|
|
} |
|
59
|
|
|
|
|
60
|
|
|
/** |
|
61
|
|
|
* {@inheritDoc} |
|
62
|
|
|
*/ |
|
63
|
|
|
public function getKernelEventListener(): ?KernelEventListener { |
|
64
|
|
|
return parent::getKernelEventListener(); |
|
65
|
|
|
} |
|
66
|
|
|
|
|
67
|
|
|
/** |
|
68
|
|
|
* {@inheritDoc} |
|
69
|
|
|
*/ |
|
70
|
|
|
public function getLogger(): ?LoggerInterface { |
|
71
|
|
|
return parent::getLogger(); |
|
72
|
|
|
} |
|
73
|
|
|
|
|
74
|
|
|
/** |
|
75
|
|
|
* {@inheritDoc} |
|
76
|
|
|
*/ |
|
77
|
|
|
public function getMailer(): ?MailerInterface { |
|
78
|
|
|
return parent::getMailer(); |
|
79
|
|
|
} |
|
80
|
|
|
|
|
81
|
|
|
/** |
|
82
|
|
|
* {@inheritDoc} |
|
83
|
|
|
*/ |
|
84
|
|
|
public function getRouter(): ?RouterInterface { |
|
85
|
|
|
return parent::getRouter(); |
|
86
|
|
|
} |
|
87
|
|
|
|
|
88
|
|
|
/** |
|
89
|
|
|
* {@inheritDoc} |
|
90
|
|
|
*/ |
|
91
|
|
|
public function getSession(): ?SessionInterface { |
|
92
|
|
|
return parent::getSession(); |
|
93
|
|
|
} |
|
94
|
|
|
|
|
95
|
|
|
/** |
|
96
|
|
|
* {@inheritDoc} |
|
97
|
|
|
*/ |
|
98
|
|
|
public function getTranslator(): TranslatorInterface { |
|
99
|
|
|
return parent::getTranslator(); |
|
100
|
|
|
} |
|
101
|
|
|
|
|
102
|
|
|
/** |
|
103
|
|
|
* {@inheritDoc} |
|
104
|
|
|
*/ |
|
105
|
|
|
public function getTwig(): ?Environment { |
|
106
|
|
|
return parent::getTwig(); |
|
107
|
|
|
} |
|
108
|
|
|
|
|
109
|
|
|
/** |
|
110
|
|
|
* {@inheritDoc} |
|
111
|
|
|
*/ |
|
112
|
|
|
public function hasRolesOrRedirect(array $roles, bool $or, string $redirectUrl, string $originUrl = ""): void { |
|
113
|
|
|
parent::hasRolesOrRedirect($roles, $or, $redirectUrl, $originUrl); |
|
114
|
|
|
} |
|
115
|
|
|
|
|
116
|
|
|
/** |
|
117
|
|
|
* {@inheritDoc} |
|
118
|
|
|
*/ |
|
119
|
|
|
public function newDefaultJsonResponseData(bool $success, array $data, string $message = null): DefaultJsonResponseDataInterface { |
|
120
|
|
|
return parent::newDefaultJsonResponseData($success, $data, $message); |
|
121
|
|
|
} |
|
122
|
|
|
|
|
123
|
|
|
/** |
|
124
|
|
|
* {@inheritDoc} |
|
125
|
|
|
*/ |
|
126
|
|
|
public function notify(string $eventName, NotificationInterface $notification): ?NotificationEvent { |
|
127
|
|
|
return parent::notify($eventName, $notification); |
|
128
|
|
|
} |
|
129
|
|
|
|
|
130
|
|
|
/** |
|
131
|
|
|
* {@inheritDoc} |
|
132
|
|
|
*/ |
|
133
|
|
|
public function toast(string $eventName, ToastInterface $toast): ?ToastEvent { |
|
134
|
|
|
return parent::toast($eventName, $toast); |
|
135
|
|
|
} |
|
136
|
|
|
|
|
137
|
|
|
/** |
|
138
|
|
|
* {@inheritDoc} |
|
139
|
|
|
*/ |
|
140
|
|
|
public function translate(string $id, array $parameters = [], string $domain = null, string $locale = null): string { |
|
141
|
|
|
return parent::translate($id, $parameters, $domain, $locale); |
|
142
|
|
|
} |
|
143
|
|
|
} |
|
144
|
|
|
|