diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index dfc88ec..4e54fd8 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -20,7 +20,8 @@ jobs: - { os: ubuntu-latest, php: 7.3, experimental: false} - { os: ubuntu-latest, php: 7.4, experimental: false} - { os: ubuntu-latest, php: 8.0, experimental: false} - - { os: ubuntu-latest, php: 8.1, experimental: true} + - { os: ubuntu-latest, php: 8.1, experimental: false } + - { os: ubuntu-latest, php: 8.2, packages: symfony/symfony=6.*, experimental: true } - { os: ubuntu-latest, php: 7.1, packages: symfony/symfony=3.4.*, experimental: false} - { os: ubuntu-latest, php: 7.1, packages: symfony/symfony=4.0.*, experimental: false} - { os: ubuntu-latest, php: 8.0, packages: symfony/symfony=4.*, experimental: false} diff --git a/.gitignore b/.gitignore index e621940..dafd436 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ vendor/ build/ target/ .php_cs.cache +.idea/ \ No newline at end of file diff --git a/composer.json b/composer.json index 95f6176..f41b393 100644 --- a/composer.json +++ b/composer.json @@ -21,16 +21,18 @@ "doctrine/dbal": "^2.3", "doctrine/doctrine-bundle": "~1.5 || ^2.0", "doctrine/orm": "~2.4", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0 || ^10.0", "predis/predis": "^1.1", - "symfony/browser-kit": "~2.8 || ~3.0 || ~4.0 || ^5.0", - "symfony/config": "~2.8 || ~3.0 || ~4.0 || ^5.0", - "symfony/dependency-injection": "~2.8 || ~3.0 || ~4.0 || ^5.0", - "symfony/framework-bundle": "~2.8 || ~3.0 || ~4.0 || ^5.0", - "symfony/http-kernel": "~2.8 || ~3.0 || ~4.0 || ^5.0", - "symfony/routing": "~2.8 || ~3.0 || ~4.0 || ^5.0", - "symfony/stopwatch": "~2.8 || ~3.0 || ~4.0 || ^5.0", - "symfony/yaml": "~2.8 || ~3.0 || ~4.0 || ^5.0" + "symfony/browser-kit": "~2.8 || ~3.0 || ~4.0 || ^5.0 || ^6.0", + "symfony/config": "~2.8 || ~3.0 || ~4.0 || ^5.0 || ^6.0", + "symfony/dependency-injection": "~2.8 || ~3.0 || ~4.0 || ^5.0 || ^6.0", + "symfony/framework-bundle": "~2.8 || ~3.0 || ~4.0 || ^5.0 || ^6.0", + "symfony/http-kernel": "~2.8 || ~3.0 || ~4.0 || ^5.0 || ^6.0", + "symfony/routing": "~2.8 || ~3.0 || ~4.0 || ^5.0 || ^6.0", + "symfony/stopwatch": "~2.8 || ~3.0 || ~4.0 || ^5.0 || ^6.0", + "symfony/yaml": "~2.8 || ~3.0 || ~4.0 || ^5.0 || ^6.0", + "symfony/dom-crawler": "~2.8 || ~3.0 || ~4.0 || ^5.0 || ^6.0", + "symfony/monolog-bundle": "~2.0 || ~3.0" }, "autoload": { "psr-4": { diff --git a/phpunit.xml b/phpunit.xml index fc8a831..9b4005b 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,37 +1,25 @@ - - - - - - ./tests/ - - - - - - - - - - - - - - ./src/ - - ./build/ - ./vendor/ - ./tests/ - - - + + + + ./tests/ + + + + + + + + + + + + ./src/ + + + ./build/ + ./vendor/ + ./tests/ + + diff --git a/tests/Adapters/Redis/RedisConnectionTest.php b/tests/Adapters/Redis/RedisConnectionTest.php index de8b5b0..9fb08db 100644 --- a/tests/Adapters/Redis/RedisConnectionTest.php +++ b/tests/Adapters/Redis/RedisConnectionTest.php @@ -51,7 +51,7 @@ public function testAdjustMetric(): void ->expects($this->once()) ->method('hincrbyfloat') ->with(self::METRICS_KEY, $expectedField, $value) - ->willReturn(17); + ->willReturn(17.0); $actual = $this->redisConnection->adjustMetric('test', $value, ['severity' => 'high']); self::assertEquals(17, $actual); diff --git a/tests/MetricBundle/AbstractMetricBundleTest.php b/tests/MetricBundle/AbstractMetricBundleTestClass.php similarity index 93% rename from tests/MetricBundle/AbstractMetricBundleTest.php rename to tests/MetricBundle/AbstractMetricBundleTestClass.php index 286bf57..d31e727 100644 --- a/tests/MetricBundle/AbstractMetricBundleTest.php +++ b/tests/MetricBundle/AbstractMetricBundleTestClass.php @@ -10,8 +10,9 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\Filesystem\Filesystem; +use Symfony\Component\HttpKernel\KernelInterface; -abstract class AbstractMetricBundleTest extends WebTestCase +abstract class AbstractMetricBundleTestClass extends WebTestCase { /** @var Client */ protected static $client; @@ -33,7 +34,7 @@ protected static function getEntityManager(): EntityManagerInterface return static::$em; } - protected static function createKernel(array $options = []) + protected static function createKernel(array $options = []): KernelInterface { $kernel = parent::createKernel($options); $fs = new Filesystem(); diff --git a/tests/MetricBundle/DependencyInjection/ConfigurationTest.php b/tests/MetricBundle/DependencyInjection/ConfigurationTest.php index 9f9204a..07d6a96 100644 --- a/tests/MetricBundle/DependencyInjection/ConfigurationTest.php +++ b/tests/MetricBundle/DependencyInjection/ConfigurationTest.php @@ -11,7 +11,7 @@ */ final class ConfigurationTest extends TestCase { - public function getSamples(): array + public static function getSamples(): array { $files = glob(__DIR__ . '/valid_config_samples/*.yml'); diff --git a/tests/MetricBundle/Fixtures/TestKernel.php b/tests/MetricBundle/Fixtures/TestKernel.php index d2ad56d..39e14cf 100644 --- a/tests/MetricBundle/Fixtures/TestKernel.php +++ b/tests/MetricBundle/Fixtures/TestKernel.php @@ -11,7 +11,7 @@ final class TestKernel extends Kernel { /** {@inheritdoc} */ - public function registerBundles() + public function registerBundles(): iterable { return [ new FrameworkBundle(), @@ -27,22 +27,22 @@ public function registerContainerConfiguration(LoaderInterface $loader) $loader->load(__DIR__ . '/config.yml'); } - public function getRootDir() + public function getRootDir(): string { return __DIR__; } - public function getProjectDir() + public function getProjectDir(): string { return __DIR__; } - public function getCacheDir() + public function getCacheDir(): string { return __DIR__ . '/../../../build/cache'; } - public function getLogDir() + public function getLogDir(): string { return __DIR__ . '/../../../build/logs'; } diff --git a/tests/MetricBundle/MetricRespondingTest.php b/tests/MetricBundle/MetricRespondingTest.php index d3503f0..20a113e 100644 --- a/tests/MetricBundle/MetricRespondingTest.php +++ b/tests/MetricBundle/MetricRespondingTest.php @@ -18,9 +18,9 @@ * @covers \Lamoda\Metric\MetricBundle\DependencyInjection\DefinitionFactory\Source * @runTestsInSeparateProcesses */ -final class MetricRespondingTest extends AbstractMetricBundleTest +final class MetricRespondingTest extends AbstractMetricBundleTestClass { - public function getTelegrafTestRoutes(): array + public static function getTelegrafTestRoutes(): array { return [ 'basic' => ['/metrics/telegraf_json'], diff --git a/tests/MetricBundle/StoredMetricMutatorTest.php b/tests/MetricBundle/StoredMetricMutatorTest.php index 60e564f..5471e72 100644 --- a/tests/MetricBundle/StoredMetricMutatorTest.php +++ b/tests/MetricBundle/StoredMetricMutatorTest.php @@ -18,7 +18,7 @@ * @covers \Lamoda\Metric\MetricBundle\DependencyInjection\DefinitionFactory\Source * @runTestsInSeparateProcesses */ -final class StoredMetricMutatorTest extends AbstractMetricBundleTest +final class StoredMetricMutatorTest extends AbstractMetricBundleTestClass { public function testAdjustableMetrics(): void {