aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/api/controllers
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2020-10-13 12:26:01 +0200
committerGitHub <noreply@github.com>2020-10-13 12:26:01 +0200
commit543b16b4f4bbde4e9857490e2175e44b4d941eb3 (patch)
treeae73131d19ceccf2514f8fa145c9a612c638cdfa /tests/api/controllers
parent8f269b49d7063af5a43021c8775b02d17205a7b5 (diff)
parentb06fc28aa32f477e1785cd998385fdb490bc5ebf (diff)
downloadShaarli-543b16b4f4bbde4e9857490e2175e44b4d941eb3.tar.gz
Shaarli-543b16b4f4bbde4e9857490e2175e44b4d941eb3.tar.zst
Shaarli-543b16b4f4bbde4e9857490e2175e44b4d941eb3.zip
Merge pull request #1525 from ArthurHoaro/feature/rest-api-bookmark-dates
REST API: allow override of creation and update dates
Diffstat (limited to 'tests/api/controllers')
-rw-r--r--tests/api/controllers/links/PostLinkTest.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/api/controllers/links/PostLinkTest.php b/tests/api/controllers/links/PostLinkTest.php
index fe3de66f..20694571 100644
--- a/tests/api/controllers/links/PostLinkTest.php
+++ b/tests/api/controllers/links/PostLinkTest.php
@@ -160,6 +160,8 @@ class PostLinkTest extends TestCase
160 'description' => 'shaare description', 160 'description' => 'shaare description',
161 'tags' => ['one', 'two'], 161 'tags' => ['one', 'two'],
162 'private' => true, 162 'private' => true,
163 'created' => '2015-05-05T12:30:00+03:00',
164 'updated' => '2016-06-05T14:32:10+03:00',
163 ]; 165 ];
164 $env = Environment::mock([ 166 $env = Environment::mock([
165 'REQUEST_METHOD' => 'POST', 167 'REQUEST_METHOD' => 'POST',
@@ -181,10 +183,8 @@ class PostLinkTest extends TestCase
181 $this->assertEquals($link['description'], $data['description']); 183 $this->assertEquals($link['description'], $data['description']);
182 $this->assertEquals($link['tags'], $data['tags']); 184 $this->assertEquals($link['tags'], $data['tags']);
183 $this->assertEquals(true, $data['private']); 185 $this->assertEquals(true, $data['private']);
184 $this->assertTrue( 186 $this->assertSame($link['created'], $data['created']);
185 new \DateTime('2 seconds ago') < \DateTime::createFromFormat(\DateTime::ATOM, $data['created']) 187 $this->assertSame($link['updated'], $data['updated']);
186 );
187 $this->assertEquals('', $data['updated']);
188 } 188 }
189 189
190 /** 190 /**