diff --git a/.docs/README.md b/.docs/README.md index 0cbbf89..c5d1b8e 100644 --- a/.docs/README.md +++ b/.docs/README.md @@ -144,7 +144,6 @@ When you are directly on some api url, you can use query parameter `?__apiDocuGe apiDocu: apiDir: "%wwwDir%/api" - extensions: apiRouter: Contributte\ApiRouter\DI\ApiRouterExtension apiDocu: Contributte\ApiDocu\DI\ApiDocuExtension diff --git a/tests/.coveralls.yml b/tests/.coveralls.yml new file mode 100644 index 0000000..a5dd742 --- /dev/null +++ b/tests/.coveralls.yml @@ -0,0 +1,4 @@ +# for php-coveralls +service_name: php-coveralls +coverage_clover: coverage.xml +json_path: coverage.json diff --git a/tests/.gitignore b/tests/.gitignore new file mode 100644 index 0000000..f0d3402 --- /dev/null +++ b/tests/.gitignore @@ -0,0 +1,10 @@ +# Folders - recursive +*.expected +*.actual + +# Folders +/tmp + +# Files +/*.log +/*.html diff --git a/tests/.gitkeep b/tests/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/tests/Cases/DI/ApiDocuExtension.phpt b/tests/Cases/DI/ApiDocuExtension.phpt new file mode 100644 index 0000000..2e3cb03 --- /dev/null +++ b/tests/Cases/DI/ApiDocuExtension.phpt @@ -0,0 +1,43 @@ +load(function (Compiler $compiler): void { + $compiler->addExtension('apiRouter', new ApiRouterExtension()); + $compiler->addExtension('apiDocu', new ApiDocuExtension()); + $compiler->addExtension('http', new HttpExtension()); + $compiler->addExtension('latte', new LatteExtension(Environment::getTestDir())); + + $compiler->addConfig([ + 'parameters' => [ + 'wwwDir' => Environment::getTestDir(), + 'tempDir' => Environment::getTestDir(), + 'debugMode' => false, + ], + ]); + $compiler->addConfig(\Contributte\Tester\Utils\Neonkit::load(<<<'NEON' + services: + router: Nette\Routing\SimpleRouter + NEON + )); + }); + + /** @var Container $container */ + $container = new $class(); + + Assert::type(Generator::class, $container->getByType(Generator::class)); +}); diff --git a/tests/bootstrap.php b/tests/bootstrap.php new file mode 100644 index 0000000..86c92a0 --- /dev/null +++ b/tests/bootstrap.php @@ -0,0 +1,10 @@ +