Skip to content

Commit

Permalink
[ns-panel-connector] Finalizing connector implementation (#137)
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Aug 9, 2023
1 parent 68d4f71 commit 87a721e
Show file tree
Hide file tree
Showing 19 changed files with 61 additions and 4 deletions.
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
}
],
"no-useless-computed-key": "off",
"vue/no-setup-props-destructure": "off",
"@typescript-eslint/explicit-function-return-type": ["error"],
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-explicit-any": "off",
Expand Down
2 changes: 1 addition & 1 deletion src/Entities/Triggers/AutomaticTrigger.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function setConditions(array $conditions = []): void
$this->conditions = new Common\Collections\ArrayCollection();

foreach ($conditions as $entity) {
$this->conditions->add($entity);
$this->addCondition($entity);
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/Entities/Triggers/Trigger.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public function setActions(array $actions = []): void
$this->actions = new Common\Collections\ArrayCollection();

foreach ($actions as $entity) {
$this->actions->add($entity);
$this->addAction($entity);
}
}

Expand Down Expand Up @@ -178,7 +178,7 @@ public function setNotifications(array $notifications = []): void
$this->notifications = new Common\Collections\ArrayCollection();

foreach ($notifications as $entity) {
$this->notifications->add($entity);
$this->addNotification($entity);
}
}

Expand Down Expand Up @@ -224,7 +224,7 @@ public function setControls(array $controls = []): void
$this->controls = new Common\Collections\ArrayCollection();

foreach ($controls as $entity) {
$this->controls->add($entity);
$this->addControl($entity);
}
}

Expand Down
5 changes: 5 additions & 0 deletions tests/cases/unit/Controllers/ActionsV1Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace FastyBird\Module\Triggers\Tests\Cases\Unit\Controllers;

use Error;
use FastyBird\Library\Bootstrap\Exceptions as BootstrapExceptions;
use FastyBird\Library\Metadata;
use FastyBird\Module\Triggers\Tests\Cases\Unit\DbTestCase;
Expand Down Expand Up @@ -29,6 +30,7 @@ final class ActionsV1Test extends DbTestCase
* @throws InvalidArgumentException
* @throws Nette\DI\MissingServiceException
* @throws RuntimeException
* @throws Error
* @throws Utils\JsonException
*
* @dataProvider actionsRead
Expand Down Expand Up @@ -212,6 +214,7 @@ public static function actionsRead(): array
* @throws InvalidArgumentException
* @throws Nette\DI\MissingServiceException
* @throws RuntimeException
* @throws Error
* @throws Utils\JsonException
*
* @dataProvider actionsCreate
Expand Down Expand Up @@ -329,6 +332,7 @@ public static function actionsCreate(): array
* @throws InvalidArgumentException
* @throws Nette\DI\MissingServiceException
* @throws RuntimeException
* @throws Error
* @throws Utils\JsonException
*
* @dataProvider actionsUpdate
Expand Down Expand Up @@ -459,6 +463,7 @@ public static function actionsUpdate(): array
* @throws InvalidArgumentException
* @throws Nette\DI\MissingServiceException
* @throws RuntimeException
* @throws Error
* @throws Utils\JsonException
*
* @dataProvider actionsDelete
Expand Down
5 changes: 5 additions & 0 deletions tests/cases/unit/Controllers/ConditionsV1Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace FastyBird\Module\Triggers\Tests\Cases\Unit\Controllers;

use Error;
use FastyBird\Library\Bootstrap\Exceptions as BootstrapExceptions;
use FastyBird\Library\Metadata;
use FastyBird\Module\Triggers\Tests\Cases\Unit\DbTestCase;
Expand Down Expand Up @@ -29,6 +30,7 @@ final class ConditionsV1Test extends DbTestCase
* @throws InvalidArgumentException
* @throws Nette\DI\MissingServiceException
* @throws RuntimeException
* @throws Error
* @throws Utils\JsonException
*
* @dataProvider conditionsRead
Expand Down Expand Up @@ -225,6 +227,7 @@ public static function conditionsRead(): array
* @throws InvalidArgumentException
* @throws Nette\DI\MissingServiceException
* @throws RuntimeException
* @throws Error
* @throws Utils\JsonException
*
* @dataProvider conditionsCreate
Expand Down Expand Up @@ -356,6 +359,7 @@ public static function conditionsCreate(): array
* @throws InvalidArgumentException
* @throws Nette\DI\MissingServiceException
* @throws RuntimeException
* @throws Error
* @throws Utils\JsonException
*
* @dataProvider conditionsUpdate
Expand Down Expand Up @@ -490,6 +494,7 @@ public static function conditionsUpdate(): array
* @throws InvalidArgumentException
* @throws Nette\DI\MissingServiceException
* @throws RuntimeException
* @throws Error
* @throws Utils\JsonException
*
* @dataProvider conditionsDelete
Expand Down
5 changes: 5 additions & 0 deletions tests/cases/unit/Controllers/NotificationsV1Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace FastyBird\Module\Triggers\Tests\Cases\Unit\Controllers;

use Error;
use FastyBird\Library\Bootstrap\Exceptions as BootstrapExceptions;
use FastyBird\Library\Metadata;
use FastyBird\Module\Triggers\Tests\Cases\Unit\DbTestCase;
Expand Down Expand Up @@ -29,6 +30,7 @@ final class NotificationsV1Test extends DbTestCase
* @throws InvalidArgumentException
* @throws Nette\DI\MissingServiceException
* @throws RuntimeException
* @throws Error
* @throws Utils\JsonException
*
* @dataProvider notificationsRead
Expand Down Expand Up @@ -212,6 +214,7 @@ public static function notificationsRead(): array
* @throws InvalidArgumentException
* @throws Nette\DI\MissingServiceException
* @throws RuntimeException
* @throws Error
* @throws Utils\JsonException
*
* @dataProvider notificationsCreate
Expand Down Expand Up @@ -354,6 +357,7 @@ public static function notificationsCreate(): array
* @throws InvalidArgumentException
* @throws Nette\DI\MissingServiceException
* @throws RuntimeException
* @throws Error
* @throws Utils\JsonException
*
* @dataProvider notificationsUpdate
Expand Down Expand Up @@ -488,6 +492,7 @@ public static function notificationsUpdate(): array
* @throws InvalidArgumentException
* @throws Nette\DI\MissingServiceException
* @throws RuntimeException
* @throws Error
* @throws Utils\JsonException
*
* @dataProvider notificationsDelete
Expand Down
2 changes: 2 additions & 0 deletions tests/cases/unit/Controllers/TriggerControlsV1Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace FastyBird\Module\Triggers\Tests\Cases\Unit\Controllers;

use Error;
use FastyBird\Library\Bootstrap\Exceptions as BootstrapExceptions;
use FastyBird\Library\Metadata;
use FastyBird\Module\Triggers\Tests\Cases\Unit\DbTestCase;
Expand All @@ -28,6 +29,7 @@ final class TriggerControlsV1Test extends DbTestCase
* @throws InvalidArgumentException
* @throws Nette\DI\MissingServiceException
* @throws RuntimeException
* @throws Error
* @throws Utils\JsonException
*
* @dataProvider triggerControlsRead
Expand Down
5 changes: 5 additions & 0 deletions tests/cases/unit/Controllers/TriggersV1Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace FastyBird\Module\Triggers\Tests\Cases\Unit\Controllers;

use Error;
use FastyBird\Library\Bootstrap\Exceptions as BootstrapExceptions;
use FastyBird\Library\Metadata;
use FastyBird\Module\Triggers\Tests\Cases\Unit\DbTestCase;
Expand Down Expand Up @@ -32,6 +33,7 @@ final class TriggersV1Test extends DbTestCase
* @throws InvalidArgumentException
* @throws Nette\DI\MissingServiceException
* @throws RuntimeException
* @throws Error
* @throws Utils\JsonException
*
* @dataProvider triggersRead
Expand Down Expand Up @@ -207,6 +209,7 @@ public static function triggersRead(): array
* @throws InvalidArgumentException
* @throws Nette\DI\MissingServiceException
* @throws RuntimeException
* @throws Error
* @throws Utils\JsonException
*
* @dataProvider triggersCreate
Expand Down Expand Up @@ -344,6 +347,7 @@ public static function triggersCreate(): array
* @throws InvalidArgumentException
* @throws Nette\DI\MissingServiceException
* @throws RuntimeException
* @throws Error
* @throws Utils\JsonException
*
* @dataProvider triggersUpdate
Expand Down Expand Up @@ -457,6 +461,7 @@ public static function triggersUpdate(): array
* @throws InvalidArgumentException
* @throws Nette\DI\MissingServiceException
* @throws RuntimeException
* @throws Error
* @throws Utils\JsonException
*
* @dataProvider triggersDelete
Expand Down
2 changes: 2 additions & 0 deletions tests/cases/unit/DI/TriggersModuleExtensionTests.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace FastyBird\Module\Triggers\Tests\Cases\Unit\DI;

use Error;
use FastyBird\Library\Bootstrap\Exceptions as BootstrapExceptions;
use FastyBird\Module\Triggers\Commands;
use FastyBird\Module\Triggers\Controllers;
Expand All @@ -25,6 +26,7 @@ final class TriggersModuleExtensionTests extends DbTestCase
* @throws Exceptions\InvalidArgument
* @throws Nette\DI\MissingServiceException
* @throws RuntimeException
* @throws Error
*/
public function testServicesRegistration(): void
{
Expand Down
10 changes: 10 additions & 0 deletions tests/cases/unit/DbTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use DateTimeImmutable;
use Doctrine\DBAL;
use Doctrine\ORM;
use Error;
use FastyBird\DateTimeFactory;
use FastyBird\Library\Bootstrap\Boot as BootstrapBoot;
use FastyBird\Library\Bootstrap\Exceptions as BootstrapExceptions;
Expand Down Expand Up @@ -67,6 +68,7 @@ abstract class DbTestCase extends TestCase
* @throws Exceptions\InvalidArgument
* @throws Nette\DI\MissingServiceException
* @throws RuntimeException
* @throws Error
*/
public function setUp(): void
{
Expand Down Expand Up @@ -97,6 +99,7 @@ protected function registerDatabaseSchemaFile(string $file): void
* @throws Exceptions\InvalidArgument
* @throws Nette\DI\MissingServiceException
* @throws RuntimeException
* @throws Error
*/
protected function mockContainerService(
string $serviceType,
Expand All @@ -116,6 +119,7 @@ protected function mockContainerService(
* @throws Exceptions\InvalidArgument
* @throws Nette\DI\MissingServiceException
* @throws RuntimeException
* @throws Error
*/
protected function getContainer(): Nette\DI\Container
{
Expand All @@ -131,6 +135,7 @@ protected function getContainer(): Nette\DI\Container
* @throws Exceptions\InvalidArgument
* @throws Nette\DI\MissingServiceException
* @throws RuntimeException
* @throws Error
*/
private function createContainer(): Nette\DI\Container
{
Expand Down Expand Up @@ -168,6 +173,7 @@ private function createContainer(): Nette\DI\Container
* @throws Exceptions\InvalidArgument
* @throws Nette\DI\MissingServiceException
* @throws RuntimeException
* @throws Error
*/
private function setupDatabase(): void
{
Expand Down Expand Up @@ -201,6 +207,7 @@ private function setupDatabase(): void
* @throws Exceptions\InvalidArgument
* @throws Nette\DI\MissingServiceException
* @throws RuntimeException
* @throws Error
*/
protected function getDb(): DBAL\Connection
{
Expand All @@ -212,6 +219,7 @@ protected function getDb(): DBAL\Connection
* @throws Exceptions\InvalidArgument
* @throws Nette\DI\MissingServiceException
* @throws RuntimeException
* @throws Error
*/
protected function getEntityManager(): NettrineORM\EntityManagerDecorator
{
Expand Down Expand Up @@ -273,6 +281,7 @@ private function loadFromFile(DBAL\Connection $db, string $file): void
* @throws Exceptions\InvalidArgument
* @throws Nette\DI\MissingServiceException
* @throws RuntimeException
* @throws Error
*/
private function replaceContainerService(string $serviceName, object $service): void
{
Expand All @@ -293,6 +302,7 @@ protected function registerNeonConfigurationFile(string $file): void
* @throws BootstrapExceptions\InvalidArgument
* @throws Exceptions\InvalidArgument
* @throws RuntimeException
* @throws Error
*/
protected function tearDown(): void
{
Expand Down
2 changes: 2 additions & 0 deletions tests/cases/unit/Entities/Actions/ActionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace FastyBird\Module\Triggers\Tests\Cases\Unit\Entities\Actions;

use Error;
use FastyBird\Library\Bootstrap\Exceptions as BootstrapExceptions;
use FastyBird\Module\Triggers\Exceptions;
use FastyBird\Module\Triggers\Models;
Expand All @@ -25,6 +26,7 @@ final class ActionTest extends DbTestCase
* @throws Exceptions\InvalidState
* @throws Nette\DI\MissingServiceException
* @throws RuntimeException
* @throws Error
*/
public function testValidation(): void
{
Expand Down
2 changes: 2 additions & 0 deletions tests/cases/unit/Entities/Conditions/ConditionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace FastyBird\Module\Triggers\Tests\Cases\Unit\Entities\Conditions;

use Error;
use FastyBird\Library\Bootstrap\Exceptions as BootstrapExceptions;
use FastyBird\Module\Triggers\Exceptions;
use FastyBird\Module\Triggers\Models;
Expand All @@ -25,6 +26,7 @@ final class ConditionTest extends DbTestCase
* @throws Exceptions\InvalidState
* @throws Nette\DI\MissingServiceException
* @throws RuntimeException
* @throws Error
*/
public function testValidation(): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace FastyBird\Module\Triggers\Tests\Cases\Unit\Models\Repositories;

use Error;
use FastyBird\Library\Bootstrap\Exceptions as BootstrapExceptions;
use FastyBird\Module\Triggers\Exceptions;
use FastyBird\Module\Triggers\Models;
Expand All @@ -26,6 +27,7 @@ final class ActionsRepositoryTest extends DbTestCase
* @throws Exceptions\InvalidState
* @throws Nette\DI\MissingServiceException
* @throws RuntimeException
* @throws Error
*/
public function testReadOne(): void
{
Expand All @@ -47,6 +49,7 @@ public function testReadOne(): void
* @throws Exceptions\InvalidState
* @throws Nette\DI\MissingServiceException
* @throws RuntimeException
* @throws Error
*/
public function testReadResultSet(): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace FastyBird\Module\Triggers\Tests\Cases\Unit\Models\Repositories;

use Error;
use FastyBird\Library\Bootstrap\Exceptions as BootstrapExceptions;
use FastyBird\Module\Triggers\Exceptions;
use FastyBird\Module\Triggers\Models;
Expand All @@ -26,6 +27,7 @@ final class ConditionsRepositoryTest extends DbTestCase
* @throws Exceptions\InvalidState
* @throws Nette\DI\MissingServiceException
* @throws RuntimeException
* @throws Error
*/
public function testReadOne(): void
{
Expand All @@ -47,6 +49,7 @@ public function testReadOne(): void
* @throws Exceptions\InvalidState
* @throws Nette\DI\MissingServiceException
* @throws RuntimeException
* @throws Error
*/
public function testReadResultSet(): void
{
Expand Down
Loading

0 comments on commit 87a721e

Please sign in to comment.