summaryrefslogtreecommitdiff
path: root/tests/units/Model/ColumnMoveRestrictionModelTest.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-09-11 18:32:47 -0400
committerFrederic Guillot <fred@kanboard.net>2016-09-11 18:32:47 -0400
commitc84df535b6bdc7260144872fc4e0c241a5a5ad61 (patch)
treed0e1dfe683fc338298f64e67e69cbbb26455e08c /tests/units/Model/ColumnMoveRestrictionModelTest.php
parentd8f6d8568396816a6bfaca1e01211384e803cf91 (diff)
Improve column restrictions
Diffstat (limited to 'tests/units/Model/ColumnMoveRestrictionModelTest.php')
-rw-r--r--tests/units/Model/ColumnMoveRestrictionModelTest.php46
1 files changed, 0 insertions, 46 deletions
diff --git a/tests/units/Model/ColumnMoveRestrictionModelTest.php b/tests/units/Model/ColumnMoveRestrictionModelTest.php
index c0ed18ac..0fc1d470 100644
--- a/tests/units/Model/ColumnMoveRestrictionModelTest.php
+++ b/tests/units/Model/ColumnMoveRestrictionModelTest.php
@@ -54,32 +54,6 @@ class ColumnMoveRestrictionModelTest extends Base
$this->assertEquals(3, $restriction['dst_column_id']);
}
- public function testGetSrcColumns()
- {
- $projectModel = new ProjectModel($this->container);
- $projectRoleModel = new ProjectRoleModel($this->container);
- $columnMoveRestrictionModel = new ColumnMoveRestrictionModel($this->container);
-
- $this->assertEquals(1, $projectModel->create(array('name' => 'Test')));
- $this->assertEquals(2, $projectModel->create(array('name' => 'Test')));
-
- $this->assertEquals(1, $projectRoleModel->create(1, 'Role A'));
- $this->assertEquals(2, $projectRoleModel->create(1, 'Role B'));
- $this->assertEquals(3, $projectRoleModel->create(2, 'Role C'));
-
- $this->assertEquals(1, $columnMoveRestrictionModel->create(1, 1, 2, 3));
- $this->assertEquals(2, $columnMoveRestrictionModel->create(1, 2, 3, 4));
-
- $columnIds = $columnMoveRestrictionModel->getAllSrcColumns(1, 'Role A');
- $this->assertEquals(2, $columnIds[2]);
-
- $this->assertEmpty($columnMoveRestrictionModel->getAllSrcColumns(2, 'Role A'));
- $this->assertEmpty($columnMoveRestrictionModel->getAllSrcColumns(2, 'Role C'));
-
- $columnIds = $columnMoveRestrictionModel->getAllSrcColumns(1, 'Role B');
- $this->assertEquals(3, $columnIds[3]);
- }
-
public function testGetAll()
{
$projectModel = new ProjectModel($this->container);
@@ -115,24 +89,4 @@ class ColumnMoveRestrictionModelTest extends Base
$this->assertEquals(3, $restrictions[1]['src_column_id']);
$this->assertEquals(4, $restrictions[1]['dst_column_id']);
}
-
- public function testIsAllowed()
- {
- $projectModel = new ProjectModel($this->container);
- $projectRoleModel = new ProjectRoleModel($this->container);
- $columnMoveRestrictionModel = new ColumnMoveRestrictionModel($this->container);
-
- $this->assertEquals(1, $projectModel->create(array('name' => 'Test')));
- $this->assertEquals(2, $projectModel->create(array('name' => 'Test')));
-
- $this->assertEquals(1, $projectRoleModel->create(1, 'Role A'));
- $this->assertEquals(2, $projectRoleModel->create(1, 'Role B'));
- $this->assertEquals(3, $projectRoleModel->create(2, 'Role C'));
-
- $this->assertEquals(1, $columnMoveRestrictionModel->create(1, 1, 2, 3));
- $this->assertEquals(2, $columnMoveRestrictionModel->create(1, 2, 3, 4));
-
- $this->assertFalse($columnMoveRestrictionModel->isAllowed(1, 'Role A', 1, 2));
- $this->assertTrue($columnMoveRestrictionModel->isAllowed(1, 'Role A', 2, 3));
- }
}