diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/functionals/ApiTest.php | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/tests/functionals/ApiTest.php b/tests/functionals/ApiTest.php index b41db6fc..9d347527 100644 --- a/tests/functionals/ApiTest.php +++ b/tests/functionals/ApiTest.php @@ -11,7 +11,7 @@ class Api extends PHPUnit_Framework_TestCase public function setUp() { - $this->client = new JsonRPC\Client(self::URL, 5, true); + $this->client = new JsonRPC\Client(self::URL); $this->client->authentication('jsonrpc', self::KEY); $pdo = new PDO('sqlite:data/db.sqlite'); @@ -132,7 +132,7 @@ class Api extends PHPUnit_Framework_TestCase 'column_id' => 2, ); - $this->assertTrue($this->client->createTask($task)); + $this->assertTrue($this->client->execute('createTask', $task)); $task = array( 'title' => 'Task #1', @@ -140,7 +140,7 @@ class Api extends PHPUnit_Framework_TestCase 'owner_id' => 1, ); - $this->assertFalse($this->client->createTask($task)); + $this->assertNull($this->client->createTask($task)); } public function testGetTask() @@ -175,7 +175,7 @@ class Api extends PHPUnit_Framework_TestCase $task['description'] = 'test'; $task['date_due'] = ''; - $this->assertTrue($this->client->updateTask($task)); + $this->assertTrue($this->client->execute('updateTask', $task)); } public function testRemoveTask() @@ -278,7 +278,7 @@ class Api extends PHPUnit_Framework_TestCase 'column_id' => 1, ); - $this->assertTrue($this->client->createTask($task)); + $this->assertTrue($this->client->execute('createTask', $task)); $comment = array( 'task_id' => 1, @@ -407,8 +407,15 @@ class Api extends PHPUnit_Framework_TestCase 'column_id' => 1, ); - $this->assertTrue($this->client->createTask($task)); + $this->assertTrue($this->client->execute('createTask', $task)); - $this->assertTrue($this->client->moveTaskPosition(1, 2, 3, 1)); + $this->assertTrue($this->client->moveTaskPosition(1, 1, 3, 1)); + + $task = $this->client->getTask(1); + + $this->assertNotFalse($task); + $this->assertTrue(is_array($task)); + $this->assertEquals(1, $task['position']); + $this->assertEquals(3, $task['column_id']); } } |