@ -41,24 +41,15 @@ trait SeriesSubscription {
[2,"http://example.net/favicon.ico", null],
[2,"http://example.net/favicon.ico", null],
],
],
],
],
'arsse_feeds' => [
'columns' => ["id", "url", "title", "username", "password", "updated", "next_fetch", "icon"],
'rows' => [
[1,"http://example.com/feed1", "Ook", "", "",strtotime("now"),strtotime("now"),null],
[2,"http://example.com/feed2", "eek", "", "",strtotime("now - 1 hour"),strtotime("now - 1 hour"),1],
[3,"http://example.com/feed3", "Ack", "", "",strtotime("now + 1 hour"),strtotime("now + 1 hour"),2],
[4,"http://example.com/feed4", "Foo", "", "",strtotime("now + 1 hour"),strtotime("now + 1 hour"),null],
],
],
'arsse_subscriptions' => [
'arsse_subscriptions' => [
'columns' => ["id", "owner", "feed", "title", "folder", "pinned", "order_type", "keep_rule", "block_rule", "scrape"],
'columns' => ["id", "owner", "url", "feed_title", "updated", "next_fetch", "icon", "title", "folder", "pinned", "order_type", "keep_rule", "block_rule", "scrape"],
'rows' => [
'rows' => [
[1,"john.doe@example.com",2,null,null,1,2,null,null,0],
[1, "john.doe@example.com", "http://example.com/feed2", "eek", strtotime("now - 1 hour"), strtotime("now - 1 hour"), 1, null, null, 1, 2, null, null, 0],
[2,"jane.doe@example.com",2,null,null,0,0,null,null,0],
[2, "jane.doe@example.com", "http://example.com/feed2", "eek", strtotime("now - 1 hour"), strtotime("now - 1 hour"), 1, null, null, 0, 0, null, null, 0],
[3,"john.doe@example.com",3 ,"Ook",2,0,1,null,null,0],
[3, "john.doe@example.com", "http://example.com/feed3", "Ack", strtotime("now + 1 hour"), strtotime("now + 1 hour"), 2, "Ook", 2, 0, 1, null, null, 0],
[4,"jill.doe@example.com",2,null,null,0,0,null,null,0],
[4, "jill.doe@example.com", "http://example.com/feed2", "eek", strtotime("now - 1 hour"), strtotime("now - 1 hour"), 1, null, null, 0, 0, null, null, 0],
[5,"jack.doe@example.com",2,null,null,1,2,"","3|E",0],
[5, "jack.doe@example.com", "http://example.com/feed2", "eek", strtotime("now - 1 hour"), strtotime("now - 1 hour"), 1, null, null, 1, 2, "", "3|E", 0],
[6,"john.doe@example.com",4 ,"Bar",3,0,0,null,null,0],
[6, "john.doe@example.com", "http://example.com/feed4", "Foo", strtotime("now + 1 hour"), strtotime("now + 1 hour"), null, "Bar", 3, 0, 0, null, null, 0],
],
],
],
],
'arsse_tags' => [
'arsse_tags' => [
@ -81,58 +72,83 @@ trait SeriesSubscription {
],
],
],
],
'arsse_articles' => [
'arsse_articles' => [
'columns' => ["id", "feed ", "url_title_hash", "url_content_hash", "title_content_hash", "title"],
'columns' => ["id", "subscription ", "url_title_hash", "url_content_hash", "title_content_hash", "title", "read", "starred", "hidden "],
'rows' => [
'rows' => [
[1,2,"","","","Title 1"],
[1, 1, "", "", "", "Title 1", 1, 0, 0],
[2,2,"","","","Title 2"],
[2, 1, "", "", "", "Title 2", 0, 0, 0],
[3,2,"","","","Title 3"],
[3, 1, "", "", "", "Title 3", 0, 0, 0],
[4,2,"","","","Title 4"],
[4, 1, "", "", "", "Title 4", 0, 0, 0],
[5,2,"","","","Title 5"],
[5, 1, "", "", "", "Title 5", 0, 0, 0],
[6,3,"","","","Title 6"],
[6, 2, "", "", "", "Title 1", 1, 0, 0],
[7,3,"","","","Title 7"],
[7, 2, "", "", "", "Title 2", 1, 0, 0],
[8,3,"","","","Title 8"],
[8, 2, "", "", "", "Title 3", 1, 0, 0],
[9, 2, "", "", "", "Title 4", 1, 0, 0],
[10, 2, "", "", "", "Title 5", 1, 0, 0],
[11, 4, "", "", "", "Title 1", 0, 0, 0],
[12, 4, "", "", "", "Title 2", 0, 0, 0],
[13, 4, "", "", "", "Title 3", 0, 0, 0],
[14, 4, "", "", "", "Title 4", 0, 0, 0],
[15, 4, "", "", "", "Title 5", 0, 0, 0],
[16, 5, "", "", "", "Title 1", 1, 0, 0],
[17, 5, "", "", "", "Title 2", 0, 0, 0],
[18, 5, "", "", "", "Title 3", 1, 0, 1],
[19, 5, "", "", "", "Title 4", 0, 0, 0],
[20, 5, "", "", "", "Title 5", 0, 0, 1],
[21, 3, "", "", "", "Title 6", 0, 0, 0],
[22, 3, "", "", "", "Title 7", 1, 0, 0],
[23, 3, "", "", "", "Title 8", 0, 0, 0],
],
],
],
],
'arsse_editions' => [
'arsse_editions' => [
'columns' => ["id", "article"],
'columns' => ["id", "article"],
'rows' => [
'rows' => [
[1,1],
[1, 1],
[2,2],
[2, 2],
[3,3],
[3, 3],
[4,4],
[4, 4],
[5,5],
[5, 5],
[6,6],
[6, 6],
[7,7],
[7, 7],
[8,8],
[8, 8],
[9, 9],
[10, 10],
[11, 11],
[12, 12],
[13, 13],
[14, 14],
[15, 15],
[16, 16],
[17, 17],
[18, 18],
[19, 19],
[20, 20],
[21, 21],
[22, 22],
[23, 23],
],
],
],
],
'arsse_categories' => [
'arsse_categories' => [
'columns' => ["article", "name"],
'columns' => ["article", "name"],
'rows' => [
'rows' => [
[1,"A"],
[1, "A"],
[2,"B"],
[2, "B"],
[4,"D"],
[4, "D"],
[5,"E"],
[5, "E"],
[6,"F"],
[6, "A"],
[7,"G"],
[7, "B"],
[8,"H"],
[9, "D"],
],
[10, "E"],
],
[11, "A"],
'arsse_marks' => [
[12, "B"],
'columns' => ["article", "subscription", "read", "starred", "hidden"],
[14, "D"],
'rows' => [
[15, "E"],
[1,2,1,0,0],
[16, "A"],
[2,2,1,0,0],
[17, "B"],
[3,2,1,0,0],
[19, "D"],
[4,2,1,0,0],
[20, "E"],
[5,2,1,0,0],
[21, "F"],
[1,1,1,0,0],
[22, "G"],
[7,3,1,0,0],
[23, "H"],
[8,3,0,0,0],
[1,5,1,0,0],
[3,5,1,0,1],
[4,5,0,0,0],
[5,5,0,0,1],
],
],
],
],
];
];
@ -151,11 +167,8 @@ trait SeriesSubscription {
Arsse::$db = $db->get();
Arsse::$db = $db->get();
$this->assertSame($subID, Arsse::$db->subscriptionAdd($this->user, $url));
$this->assertSame($subID, Arsse::$db->subscriptionAdd($this->user, $url));
$db->feedUpdate->never()->called();
$db->feedUpdate->never()->called();
$state = $this->primeExpectations($this->data, [
$state = $this->primeExpectations($this->data, ['arsse_subscriptions' => ['id', 'owner', 'feed', 'url']]);
'arsse_feeds' => ['id','url','username','password'],
$state['arsse_subscriptions']['rows'][] = [$subID, $this->user, "http://example.com/feed1"];
'arsse_subscriptions' => ['id','owner','feed'],
]);
$state['arsse_subscriptions']['rows'][] = [$subID,$this->user,1];
$this->compareExpectations(static::$drv, $state);
$this->compareExpectations(static::$drv, $state);
}
}