From 61fe673e206a8f2be1f5b1b713048f2e6ab346b5 Mon Sep 17 00:00:00 2001 From: "J. King" Date: Sun, 23 Jun 2019 18:45:24 -0400 Subject: [PATCH] Skeleton for import tests --- tests/cases/ImportExport/TestImportExport.php | 97 +++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 tests/cases/ImportExport/TestImportExport.php diff --git a/tests/cases/ImportExport/TestImportExport.php b/tests/cases/ImportExport/TestImportExport.php new file mode 100644 index 00000000..9001b119 --- /dev/null +++ b/tests/cases/ImportExport/TestImportExport.php @@ -0,0 +1,97 @@ +proc = \Phake::partialMock(AbstractImportExport::class); + // initialize an SQLite memeory database + static::setConf(); + try { + $this->drv = Driver::create(); + } catch (\JKingWeb\Arsse\Db\Exception $e) { + $this->markTestSkipped("An SQLite database is required for this test"); + } + // create the database interface with the suitable driver and apply the latest schema + Arsse::$db = new Database($this->drv); + Arsse::$db->driverSchemaUpdate(); + $this->data = [ + 'arsse_users' => [ + 'columns' => [ + 'id' => 'str', + 'password' => 'str', + ], + 'rows' => [ + ], + ], + 'arsse_folders' => [ + 'columns' => [ + 'id' => "int", + 'owner' => "str", + 'parent' => "int", + 'name' => "str", + ], + 'rows' => [ + ], + ], + 'arsse_feeds' => [ + 'columns' => [ + 'id' => "int", + 'url' => "str", + 'title' => "str", + ], + 'rows' => [ + ], + ], + 'arsse_subscriptions' => [ + 'columns' => [ + 'id' => "int", + 'owner' => "str", + 'feed' => "int", + 'title' => "str", + ], + 'rows' => [ + ], + ], + 'arsse_tags' => [ + 'columns' => [ + 'id' => "int", + 'owner' => "str", + 'name' => "str", + ], + 'rows' => [ + ], + ], + 'arsse_tag_members' => [ + 'columns' => [ + 'tag' => "int", + 'subscription' => "int", + 'assigned' => "bool", + ], + 'rows' => [ + ], + ], + ]; + } + + public function tearDown() { + $this->drv = null; + $this->proc = null; + self::clearData(); + } +}