diff --git a/tests/Feature/ExampleTest.php b/tests/Feature/ExampleTest.php deleted file mode 100644 index 61cd84c..0000000 --- a/tests/Feature/ExampleTest.php +++ /dev/null @@ -1,5 +0,0 @@ -toBeTrue(); -}); diff --git a/tests/ServiceProvider.php b/tests/ServiceProvider.php new file mode 100644 index 0000000..072505f --- /dev/null +++ b/tests/ServiceProvider.php @@ -0,0 +1,51 @@ +app = new Application(); + $this->app->bind('config', fn() => new Repository()); + $this->app->bind(Factory::class, fn() => Mockery::mock(RedisManager::class)); + $this->app->register(ServiceProvider::class); +}); + +afterAll(function () { + Mockery::close(); +}); + +it('ensures top is bound to the container', function () { + expect($this->app->get('top')) + ->toBeInstanceOf(TopManager::class); +}); + +it('ensures top.state bound to the container', function () { + expect($this->app->get('top.state')) + ->toBeInstanceOf(StateManager::class); +}); + +it('ensures top is always singleton', function () { + $top = $this->app->get('top'); + + expect($this->app->get('top'))->toBe($top); +}); + +it('ensures top facade resolves correctly', function () { + Top::setFacadeApplication($this->app); + + expect(Top::getFacadeRoot()) + ->toBeInstanceOf(TopManager::class); +}); + +it('ensures state facade resolves correctly', function () { + State::setFacadeApplication($this->app); + + expect(State::getFacadeRoot())->toBeInstanceOf(StateManager::class); +}); diff --git a/tests/Unit/ExampleTest.php b/tests/Unit/ExampleTest.php deleted file mode 100644 index 61cd84c..0000000 --- a/tests/Unit/ExampleTest.php +++ /dev/null @@ -1,5 +0,0 @@ -toBeTrue(); -});