Browse Source

Put column defs in one place in tests

dbtest
J. King 2 years ago
parent
commit
2c19aa06b7
  1. 146
      tests/cases/Database/TestDatabase.php

146
tests/cases/Database/TestDatabase.php

@ -10,6 +10,152 @@ use JKingWeb\Arsse\Database;
/** @covers \JKingWeb\Arsse\Database */
class TestDatabase extends \JKingWeb\Arsse\Test\AbstractTest {
protected const COL_DEFS = [
'arsse_meta' => [
'key' => "strict str",
'value' => "str",
],
'arsse_users' => [
'id' => "strict str",
'password' => "str",
'num' => "strict int",
'admin' => "strict bool",
],
'arsse_user_meta' => [
'owner' => "strict str",
'key' => "strict str",
'modified' => "strict datetime",
'value' => "str",
],
'arsse_sessions' => [
'id' => "strict str",
'created' => "strict datetime",
'expires' => "strict datetime",
'user' => "strict str",
],
'arsse_tokens' => [
'id' => "strict str",
'class' => "strict str",
'user' => "strict str",
'created' => "strict datetime",
'expires' => "datetime",
'data' => "str",
],
'arsse_feeds' => [
'id' => "int",
'url' => "strict str",
'title' => "str",
'source' => "str",
'updated' => "datetime",
'modified' => "datetime",
'next_fetch' => "datetime",
'orphaned' => "datetime",
'etag' => "strict str",
'err_count' => "strict int",
'err_msg' => "str",
'username' => "strict str",
'password' => "strict str",
'size' => "strict int",
'icon' => "int",
],
'arsse_icons' => [
'id' => "int",
'url' => "strict str",
'modified' => "datetime",
'etag' => "strict str",
'next_fetch' => "datetime",
'orphaned' => "datetime",
'type' => "str",
'data' => "blob",
],
'arsse_articles' => [
'id' => "int",
'feed' => "strict int",
'url' => "str",
'title' => "str",
'author' => "str",
'published' => "datetime",
'edited' => "datetime",
'modified' => "strict datetime",
'guid' => "str",
'url_title_hash' => "strict str",
'url_content_hash' => "strict str",
'title_content_hash' => "strict str",
'content_scraped' => "str",
'content' => "str",
],
'arsse_editions' => [
'id' => "int",
'article' => "strict int",
'modified' => "strict datetime",
],
'arsse_enclosures' => [
'article' => "strict int",
'url' => "str",
'type' => "str",
],
'arsse_categories' => [
'article' => "strict int",
'name' => "str",
],
'arsse_marks' => [
'article' => "strict int",
'subscription' => "strict int",
'read' => "strict bool",
'starred' => "strict bool",
'modified' => "datetime",
'note' => "strict str",
'touched' => "strict bool",
'hidden' => "strict bool",
],
'arsse_subscriptions' => [
'id' => "int",
'owner' => "strict str",
'feed' => "strict int",
'added' => "strict datetime",
'modified' => "strict datetime",
'title' => "str",
'order_type' => "strict int",
'pinned' => "strict bool",
'folder' => "int",
'keep_rule' => "str",
'block_rule' => "str",
'scrape' => "strict bool",
],
'arsse_folders' => [
'id' => "int",
'owner' => "strict str",
'parent' => "int",
'name' => "strict str",
'modified' => "strict datetime",
],
'arsse_tags' => [
'id' => "int",
'owner' => "strict str",
'name' => "strict str",
'modified' => "strict datetime",
],
'arsse_tag_members' => [
'tag' => "strict int",
'subscription' => "strict int",
'assigned' => "strict bool",
'modified' => "strict datetime",
],
'arsse_labels' => [
'id' => "int",
'owner' => "strict str",
'name' => "strict str",
'modified' => "strict datetime",
],
'arsse_label_members' => [
'label' => "strict int",
'article' => "strict int",
'subscription' => "strict int",
'assigned' => "strict bool",
'modified' => "strict datetime",
],
];
protected $db = null;
public function setUp(): void {

Loading…
Cancel
Save