Commit de55f291 authored by François Agneray's avatar François Agneray
Browse files

Fixed bug tests sur output category

parent 1a7bfc4f
......@@ -51,7 +51,8 @@ final class OutputCategoryActionTest extends AbstractActionTestCase
$this->assertSame((string) $response->getBody(), json_encode(array(
'id' => 1,
'label' => 'Default category',
'display' => 10
'display' => 10,
'id_output_family' => 1
)));
}
......@@ -66,7 +67,6 @@ final class OutputCategoryActionTest extends AbstractActionTestCase
$request = $this->getRequestForPut($editedCategory);
$response = ($this->action)($request, new \Slim\Http\Response(), array('id' => 1));
$this->assertEquals(200, (int) $response->getStatusCode());
unset($editedCategory['id_output_family']);
$this->assertSame((string) $response->getBody(), json_encode($editedCategory));
$this->assertSame(2, $this->getDatabaseTester()->getConnection()->getRowCount('output_category'));
}
......
......@@ -37,12 +37,14 @@ final class OutputCategoryListActionTest extends AbstractActionTestCase
array(
'id' => 1,
'label' => 'Default category',
'display' => 10
'display' => 10,
'id_output_family' => 1
),
array(
'id' => 2,
'label' => 'Photometry',
'display' => 20
'display' => 20,
'id_output_family' => 1
)
)));
}
......@@ -58,7 +60,6 @@ final class OutputCategoryListActionTest extends AbstractActionTestCase
$request = $this->getRequestForPost($newCategory);
$response = ($this->action)($request, new \Slim\Http\Response(), array());
$this->assertEquals(201, (int) $response->getStatusCode());
unset($newCategory['id_output_family']);
$this->assertSame((string) $response->getBody(), json_encode(array_merge(array('id' => 3), $newCategory)));
$this->assertSame(3, $this->getDatabaseTester()->getConnection()->getRowCount('output_category'));
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment