summaryrefslogtreecommitdiff
path: root/tests/integration/ColumnTest.php
diff options
context:
space:
mode:
authorGerardo Zamudio <gerardozamudio@users.noreply.github.com>2016-02-24 23:48:50 -0600
committerGerardo Zamudio <gerardozamudio@users.noreply.github.com>2016-02-24 23:48:50 -0600
commite4de6b3898b64b26d29aff31f21df5fda8055686 (patch)
tree575f8a65440f291d70a070d168eafca8c82a6459 /tests/integration/ColumnTest.php
parentd9ffbea174ea6524d0a22f8375ca8b3aa04a3c96 (diff)
parenta6540bc604c837d92c9368540c145606723e97f7 (diff)
Merge pull request #1 from fguillot/master
Update from upstream
Diffstat (limited to 'tests/integration/ColumnTest.php')
-rw-r--r--tests/integration/ColumnTest.php65
1 files changed, 65 insertions, 0 deletions
diff --git a/tests/integration/ColumnTest.php b/tests/integration/ColumnTest.php
new file mode 100644
index 00000000..6d02afc0
--- /dev/null
+++ b/tests/integration/ColumnTest.php
@@ -0,0 +1,65 @@
+<?php
+
+require_once __DIR__.'/Base.php';
+
+class ColumnTest extends Base
+{
+ public function testCreateProject()
+ {
+ $this->assertEquals(1, $this->app->createProject('A project'));
+ }
+
+ public function testGetColumns()
+ {
+ $columns = $this->app->getColumns($this->getProjectId());
+ $this->assertCount(4, $columns);
+ $this->assertEquals('Done', $columns[3]['title']);
+ }
+
+ public function testUpdateColumn()
+ {
+ $this->assertTrue($this->app->updateColumn(4, 'Boo', 2));
+
+ $columns = $this->app->getColumns($this->getProjectId());
+ $this->assertEquals('Boo', $columns[3]['title']);
+ $this->assertEquals(2, $columns[3]['task_limit']);
+ }
+
+ public function testAddColumn()
+ {
+ $column_id = $this->app->addColumn($this->getProjectId(), 'New column');
+
+ $this->assertNotFalse($column_id);
+ $this->assertInternalType('int', $column_id);
+ $this->assertTrue($column_id > 0);
+
+ $columns = $this->app->getColumns($this->getProjectId());
+ $this->assertCount(5, $columns);
+ $this->assertEquals('New column', $columns[4]['title']);
+ }
+
+ public function testRemoveColumn()
+ {
+ $this->assertTrue($this->app->removeColumn(5));
+
+ $columns = $this->app->getColumns($this->getProjectId());
+ $this->assertCount(4, $columns);
+ }
+
+ public function testChangeColumnPosition()
+ {
+ $this->assertTrue($this->app->changeColumnPosition($this->getProjectId(), 1, 3));
+
+ $columns = $this->app->getColumns($this->getProjectId());
+ $this->assertCount(4, $columns);
+
+ $this->assertEquals('Ready', $columns[0]['title']);
+ $this->assertEquals(1, $columns[0]['position']);
+ $this->assertEquals('Work in progress', $columns[1]['title']);
+ $this->assertEquals(2, $columns[1]['position']);
+ $this->assertEquals('Backlog', $columns[2]['title']);
+ $this->assertEquals(3, $columns[2]['position']);
+ $this->assertEquals('Boo', $columns[3]['title']);
+ $this->assertEquals(4, $columns[3]['position']);
+ }
+}