diff options
author | Lev Lazinskiy <lev@levlaz.org> | 2017-01-22 09:39:30 -0800 |
---|---|---|
committer | Frédéric Guillot <fred@kanboard.net> | 2017-01-22 12:39:30 -0500 |
commit | 8e18c39db9dbb0d91e28006b972dbe331e6500b4 (patch) | |
tree | 5a2f6bb37d355aafcf48f635b91b543d326d2686 /tests | |
parent | 67aca3c664dfe4a7616781216e868f9477f4963f (diff) |
Add date_modification to comments (PR #2950)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/integration/CommentProcedureTest.php | 3 | ||||
-rw-r--r-- | tests/units.postgres.xml | 2 | ||||
-rw-r--r-- | tests/units/Model/CommentModelTest.php | 3 |
3 files changed, 7 insertions, 1 deletions
diff --git a/tests/integration/CommentProcedureTest.php b/tests/integration/CommentProcedureTest.php index 881d938c..0a969420 100644 --- a/tests/integration/CommentProcedureTest.php +++ b/tests/integration/CommentProcedureTest.php @@ -35,10 +35,12 @@ class CommentProcedureTest extends BaseProcedureTest $this->assertNotEmpty($comment); $this->assertEquals(1, $comment['user_id']); $this->assertEquals('foobar', $comment['comment']); + $this->assertEquals($comment['date_creation'], $comment['date_modification']); } public function assertUpdateComment() { + sleep(1); // Integration test fails because its too fast $this->assertTrue($this->app->execute('updateComment', array( 'id' => $this->commentId, 'content' => 'test', @@ -46,6 +48,7 @@ class CommentProcedureTest extends BaseProcedureTest $comment = $this->app->getComment($this->commentId); $this->assertEquals('test', $comment['comment']); + $this->assertNotEquals($comment['date_creation'], $comment['date_modification']); } public function assertGetAllComments() diff --git a/tests/units.postgres.xml b/tests/units.postgres.xml index 3442db1c..cf538a82 100644 --- a/tests/units.postgres.xml +++ b/tests/units.postgres.xml @@ -10,4 +10,4 @@ <const name="DB_PASSWORD" value="" /> <const name="DB_NAME" value="kanboard_unit_test" /> </php> -</phpunit>
\ No newline at end of file +</phpunit> diff --git a/tests/units/Model/CommentModelTest.php b/tests/units/Model/CommentModelTest.php index 4178a839..c75401cc 100644 --- a/tests/units/Model/CommentModelTest.php +++ b/tests/units/Model/CommentModelTest.php @@ -26,6 +26,7 @@ class CommentModelTest extends Base $this->assertEquals(1, $comment['user_id']); $this->assertEquals('admin', $comment['username']); $this->assertEquals(time(), $comment['date_creation'], '', 3); + $this->assertEquals(time(), $comment['date_modification'], '', 3); $comment = $commentModel->getById(2); $this->assertNotEmpty($comment); @@ -34,6 +35,7 @@ class CommentModelTest extends Base $this->assertEquals(0, $comment['user_id']); $this->assertEquals('', $comment['username']); $this->assertEquals(time(), $comment['date_creation'], '', 3); + $this->assertEquals(time(), $comment['date_modification'], '', 3); } public function testGetAll() @@ -73,6 +75,7 @@ class CommentModelTest extends Base $comment = $commentModel->getById(1); $this->assertNotEmpty($comment); $this->assertEquals('bla', $comment['comment']); + $this->assertEquals(time(), $comment['date_modification'], '', 3); } public function testRemove() |