$this->assertEquals($entry->getUserName(), $content['user_name']);
$this->assertEquals($entry->getUserEmail(), $content['user_email']);
$this->assertEquals($entry->getUserId(), $content['user_id']);
+ $this->assertEquals($entry->getProgress(), $content['progress']);
$this->assertEquals('application/json', $this->client->getResponse()->headers->get('Content-Type'));
}
$this->assertContains('bob', $content['published_by']);
$this->assertContains('helen', $content['published_by']);
$this->assertTrue($content['is_public'], 'A public link has been generated for that entry');
+ $this->assertEquals(0, $content['progress']);
}
public function testPostSameEntry()
'authors' => 'bob,sponge',
'content' => 'awesome',
'public' => 0,
+ 'progress' => '70',
]);
$this->assertEquals(200, $this->client->getResponse()->getStatusCode());
$this->assertContains('bob', $content['published_by']);
$this->assertEquals('awesome', $content['content']);
$this->assertFalse($content['is_public'], 'Entry is no more shared');
+ $this->assertEquals(70, $content['progress']);
}
public function testPatchEntryWithoutQuotes()
$this->assertEquals(true, $content['is_starred']);
}
+ public function testChangeProgress()
+ {
+ $entry = $this->client->getContainer()
+ ->get('doctrine.orm.entity_manager')
+ ->getRepository('WallabagCoreBundle:Entry')
+ ->findOneByUser(1);
+
+ if (!$entry) {
+ $this->markTestSkipped('No content found in db.');
+ }
+
+ $this->client->request('PATCH', '/api/entries/'.$entry->getId().'json', [
+ 'progress' => 69,
+ ]);
+
+ $this->assertEquals(200, $this->client->getResponse()->getStatusCode());
+
+ $content = json_decode($this->client->getResponse()->getContent(), true);
+
+ $this->assertEquals(69, $content['progress']);
+ }
+
public function testGetEntriesExists()
{
$this->client->request('GET', '/api/entries/exists?url=http://0.0.0.0/entry2');