From bad86cedb38c35dea6b7b744da127795d6f7a14a Mon Sep 17 00:00:00 2001 From: "J. King" Date: Sat, 19 Oct 2019 12:13:42 -0400 Subject: [PATCH] Tests for bootstrapper --- tests/cases/TestArsse.php | 47 +++++++++++++++++++++++++++++++++++++++ tests/phpunit.dist.xml | 1 + 2 files changed, 48 insertions(+) create mode 100644 tests/cases/TestArsse.php diff --git a/tests/cases/TestArsse.php b/tests/cases/TestArsse.php new file mode 100644 index 00000000..179f399d --- /dev/null +++ b/tests/cases/TestArsse.php @@ -0,0 +1,47 @@ +import(['lang' => "test"]); + Arsse::load($conf2); + $this->assertSame($conf2, Arsse::$conf); + $this->assertSame($lang, Arsse::$lang); + $this->assertSame($db, Arsse::$db); + $this->assertSame($user, Arsse::$user); + \Phake::verify($lang)->set("test"); + } + + public function testLoadNewData() { + $conf = (new Conf)->import(['dbSQLite3File' => ":memory:"]); + Arsse::load($conf); + $this->assertInstanceOf(Conf::class, Arsse::$conf); + $this->assertInstanceOf(Lang::class, Arsse::$lang); + $this->assertInstanceOf(Database::class, Arsse::$db); + $this->assertInstanceOf(User::class, Arsse::$user); + } +} diff --git a/tests/phpunit.dist.xml b/tests/phpunit.dist.xml index e24e0d0b..dd2ba507 100644 --- a/tests/phpunit.dist.xml +++ b/tests/phpunit.dist.xml @@ -129,6 +129,7 @@ cases/Service/TestService.php cases/CLI/TestCLI.php + cases/TestArsse.php cases/ImportExport/TestFile.php