From ff030d43c34d606b557c6a9a44395b5382172746 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 27 Jun 2015 20:22:54 -0400 Subject: Fix functional tests --- tests/functionals.mysql.xml | 2 +- tests/functionals.postgres.xml | 2 +- tests/functionals.sqlite.xml | 2 +- tests/functionals/ApiTest.php | 15 +++++++-------- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/tests/functionals.mysql.xml b/tests/functionals.mysql.xml index 61cb05df..a8877f92 100644 --- a/tests/functionals.mysql.xml +++ b/tests/functionals.mysql.xml @@ -1,4 +1,4 @@ - + functionals diff --git a/tests/functionals.postgres.xml b/tests/functionals.postgres.xml index eb83d157..61da8574 100644 --- a/tests/functionals.postgres.xml +++ b/tests/functionals.postgres.xml @@ -1,4 +1,4 @@ - + functionals diff --git a/tests/functionals.sqlite.xml b/tests/functionals.sqlite.xml index 0d011ac3..9da59b20 100644 --- a/tests/functionals.sqlite.xml +++ b/tests/functionals.sqlite.xml @@ -1,4 +1,4 @@ - + functionals diff --git a/tests/functionals/ApiTest.php b/tests/functionals/ApiTest.php index 642288b8..b7ae80f1 100644 --- a/tests/functionals/ApiTest.php +++ b/tests/functionals/ApiTest.php @@ -43,7 +43,6 @@ class Api extends PHPUnit_Framework_TestCase { $tasks = $this->client->getAllTasks(1, 1); $this->assertNotEmpty($tasks); - $this->assertEquals(1, count($tasks)); return $tasks[0]['id']; } @@ -967,12 +966,12 @@ class Api extends PHPUnit_Framework_TestCase public function testCreateFile() { - $this->assertEquals(1, $this->client->createFile(1, 1, 'My file', base64_encode('plain text file'))); + $this->assertNotFalse($this->client->createFile(1, $this->getTaskId(), 'My file', base64_encode('plain text file'))); } public function testGetAllFiles() { - $files = $this->client->getAllFiles(array('task_id' => 1)); + $files = $this->client->getAllFiles(array('task_id' => $this->getTaskId())); $this->assertNotEmpty($files); $this->assertCount(1, $files); @@ -995,16 +994,16 @@ class Api extends PHPUnit_Framework_TestCase public function testRemoveAllFiles() { - $this->assertEquals(1, $this->client->createFile(1, 1, 'My file 1', base64_encode('plain text file'))); - $this->assertEquals(2, $this->client->createFile(1, 1, 'My file 2', base64_encode('plain text file'))); + $this->assertNotFalse($this->client->createFile(1, $this->getTaskId(), 'My file 1', base64_encode('plain text file'))); + $this->assertNotFalse($this->client->createFile(1, $this->getTaskId(), 'My file 2', base64_encode('plain text file'))); - $files = $this->client->getAllFiles(array('task_id' => 1)); + $files = $this->client->getAllFiles(array('task_id' => $this->getTaskId())); $this->assertNotEmpty($files); $this->assertCount(2, $files); - $this->assertTrue($this->client->removeAllFiles(array('task_id' => 1))); + $this->assertTrue($this->client->removeAllFiles(array('task_id' => $this->getTaskId()))); - $files = $this->client->getAllFiles(array('task_id' => 1)); + $files = $this->client->getAllFiles(array('task_id' => $this->getTaskId())); $this->assertEmpty($files); } -- cgit v1.2.3