Skip to content

Commit

Permalink
Tests: refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
f3l1x committed Dec 15, 2023
1 parent 2db7cc3 commit 1598207
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 67 deletions.
4 changes: 0 additions & 4 deletions tests/.coveralls.yml

This file was deleted.

10 changes: 0 additions & 10 deletions tests/.gitignore

This file was deleted.

27 changes: 27 additions & 0 deletions tests/Cases/DI/ConfigurationTest.phpt
@@ -0,0 +1,27 @@
<?php declare(strict_types = 1);

use Contributte\Elasticsearch\DI\ElasticsearchExtension;
use Contributte\Tester\Toolkit;
use Contributte\Tester\Utils\ContainerBuilder;
use Contributte\Tester\Utils\Neonkit;
use Elastic\Elasticsearch\Client;
use Nette\DI\Compiler;
use Nette\DI\Container;
use Tester\Assert;

require_once __DIR__ . '/../../bootstrap.php';

Toolkit::test(function (): void {
$container = ContainerBuilder::of()
->withCompiler(function (Compiler $compiler): void {
$compiler->addExtension('elasticsearch', new ElasticsearchExtension());
$compiler->addConfig(Neonkit::load(<<<'NEON'
elasticsearch:
hosts: [192.168.1.100:9999]
NEON
));
})->build();

Assert::type(Container::class, $container);
Assert::type(Client::class, $container->getService('elasticsearch.client'));
});
5 changes: 2 additions & 3 deletions tests/bootstrap.php
@@ -1,11 +1,10 @@
<?php declare(strict_types = 1);

use Ninjify\Nunjuck\Environment;
use Contributte\Tester\Environment;

if (@! include __DIR__ . '/../vendor/autoload.php') {
if (@!include __DIR__ . '/../vendor/autoload.php') {
echo 'Install Nette Tester using `composer update --dev`';
exit(1);
}

// Configure environment
Environment::setup(__DIR__);
50 changes: 0 additions & 50 deletions tests/cases/DI/ConfigurationTest.phpt

This file was deleted.

0 comments on commit 1598207

Please sign in to comment.