summaryrefslogtreecommitdiff
path: root/tests/integration/ActionTest.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-06-26 10:25:13 -0400
committerFrederic Guillot <fred@kanboard.net>2016-06-26 10:25:13 -0400
commit4a230d331ec220fc32a48525afb308af0d9787fa (patch)
tree514aa3d703155b7f97a2c77147c9fd74cef60f84 /tests/integration/ActionTest.php
parent922e0fb6de06a98774418612e0b0f75af72b6dbb (diff)
Added application and project roles validation for API procedure calls
Diffstat (limited to 'tests/integration/ActionTest.php')
-rw-r--r--tests/integration/ActionTest.php66
1 files changed, 0 insertions, 66 deletions
diff --git a/tests/integration/ActionTest.php b/tests/integration/ActionTest.php
deleted file mode 100644
index 7a5adc4a..00000000
--- a/tests/integration/ActionTest.php
+++ /dev/null
@@ -1,66 +0,0 @@
-<?php
-
-require_once __DIR__.'/BaseIntegrationTest.php';
-
-class ActionTest extends BaseIntegrationTest
-{
- protected $projectName = 'My project to test actions';
-
- public function testGetAvailableActions()
- {
- $actions = $this->app->getAvailableActions();
- $this->assertNotEmpty($actions);
- $this->assertInternalType('array', $actions);
- $this->assertArrayHasKey('\Kanboard\Action\TaskCloseColumn', $actions);
- }
-
- public function testGetAvailableActionEvents()
- {
- $events = $this->app->getAvailableActionEvents();
- $this->assertNotEmpty($events);
- $this->assertInternalType('array', $events);
- $this->assertArrayHasKey('task.move.column', $events);
- }
-
- public function testGetCompatibleActionEvents()
- {
- $events = $this->app->getCompatibleActionEvents('\Kanboard\Action\TaskCloseColumn');
- $this->assertNotEmpty($events);
- $this->assertInternalType('array', $events);
- $this->assertArrayHasKey('task.move.column', $events);
- }
-
- public function testCRUD()
- {
- $this->assertCreateTeamProject();
- $this->assertCreateAction();
- $this->assertGetActions();
- $this->assertRemoveAction();
- }
-
- public function assertCreateAction()
- {
- $actionId = $this->app->createAction($this->projectId, 'task.move.column', '\Kanboard\Action\TaskCloseColumn', array('column_id' => 1));
- $this->assertNotFalse($actionId);
- $this->assertTrue($actionId > 0);
- }
-
- public function assertGetActions()
- {
- $actions = $this->app->getActions($this->projectId);
- $this->assertNotEmpty($actions);
- $this->assertInternalType('array', $actions);
- $this->assertArrayHasKey('id', $actions[0]);
- $this->assertArrayHasKey('project_id', $actions[0]);
- $this->assertArrayHasKey('event_name', $actions[0]);
- $this->assertArrayHasKey('action_name', $actions[0]);
- $this->assertArrayHasKey('params', $actions[0]);
- $this->assertArrayHasKey('column_id', $actions[0]['params']);
- }
-
- public function assertRemoveAction()
- {
- $actionId = $this->app->createAction($this->projectId, 'task.move.column', '\Kanboard\Action\TaskCloseColumn', array('column_id' => 1));
- $this->assertTrue($this->app->removeAction($actionId));
- }
-}