Add tests

This commit is contained in:
Jeremy Benoist 2017-05-30 20:15:41 +02:00
parent 4c707d087b
commit 047fdc767a
No known key found for this signature in database
GPG key ID: BCA73962457ACC3C
3 changed files with 4 additions and 3 deletions

View file

@ -36,8 +36,8 @@ class WallabagV2Import extends WallabagImport
return [
'html' => $entry['content'],
'content_type' => $entry['mimetype'],
'is_archived' => (int) ($entry['is_archived'] || $this->markAsRead),
'is_starred' => (int) $entry['is_starred'],
'is_archived' => (bool) ($entry['is_archived'] || $this->markAsRead),
'is_starred' => (bool) $entry['is_starred'],
] + $entry;
}

View file

@ -138,6 +138,7 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase
$this->assertEquals(3, count($content->getTags()));
$this->assertInstanceOf(\DateTime::class, $content->getCreatedAt());
$this->assertEquals('2016-09-08', $content->getCreatedAt()->format('Y-m-d'));
$this->assertTrue($content->isStarred(), 'Entry is starred');
}
public function testImportWallabagWithEmptyFile()

File diff suppressed because one or more lines are too long