From b06fc28aa32f477e1785cd998385fdb490bc5ebf Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Sat, 29 Aug 2020 11:45:08 +0200 Subject: REST API: allow override of creation and update dates Note that if they're not provided, default behaviour will apply: creation and update dates will be autogenerated, and not empty. Fixes #1223 --- tests/api/controllers/links/PostLinkTest.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/api') diff --git a/tests/api/controllers/links/PostLinkTest.php b/tests/api/controllers/links/PostLinkTest.php index 4e791a04..f969fe1c 100644 --- a/tests/api/controllers/links/PostLinkTest.php +++ b/tests/api/controllers/links/PostLinkTest.php @@ -160,6 +160,8 @@ class PostLinkTest extends TestCase 'description' => 'shaare description', 'tags' => ['one', 'two'], 'private' => true, + 'created' => '2015-05-05T12:30:00+03:00', + 'updated' => '2016-06-05T14:32:10+03:00', ]; $env = Environment::mock([ 'REQUEST_METHOD' => 'POST', @@ -181,10 +183,8 @@ class PostLinkTest extends TestCase $this->assertEquals($link['description'], $data['description']); $this->assertEquals($link['tags'], $data['tags']); $this->assertEquals(true, $data['private']); - $this->assertTrue( - new \DateTime('2 seconds ago') < \DateTime::createFromFormat(\DateTime::ATOM, $data['created']) - ); - $this->assertEquals('', $data['updated']); + $this->assertSame($link['created'], $data['created']); + $this->assertSame($link['updated'], $data['updated']); } /** -- cgit v1.2.3