From 1a2db5fa537ea3c7118fb595ffa970765094c39e Mon Sep 17 00:00:00 2001 From: Fran Moreno Date: Fri, 12 Aug 2022 13:54:07 +0200 Subject: [PATCH] Removed unused files (#2111) --- CHANGELOG.md | 1 + .../Strategy/CallbackStrategyTestHelper.php | 21 ------ tests/ErrorsCollector.php | 75 ------------------- 3 files changed, 1 insertion(+), 96 deletions(-) delete mode 100644 tests/Connection/Strategy/CallbackStrategyTestHelper.php delete mode 100644 tests/ErrorsCollector.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 97bbde1e11..d5f1ad9385 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Updated `php-cs-fixer` to `3.9.5` [#2110](https://github.com/ruflin/Elastica/pull/2110) ### Deprecated ### Removed +* Removed `CallbackStrategyTestHelper` and `ErrorsCollector` from `tests` [#2111](https://github.com/ruflin/Elastica/pull/2111) ### Fixed ### Security diff --git a/tests/Connection/Strategy/CallbackStrategyTestHelper.php b/tests/Connection/Strategy/CallbackStrategyTestHelper.php deleted file mode 100644 index 2f79cc71bd..0000000000 --- a/tests/Connection/Strategy/CallbackStrategyTestHelper.php +++ /dev/null @@ -1,21 +0,0 @@ - - */ -class ErrorsCollector -{ - private $errors = []; - - /** - * @var TestCase - */ - private $testCase; - - public function __construct(?TestCase $testCase = null) - { - $this->testCase = $testCase; - } - - public function add($error): void - { - $this->errors[] = $error; - } - - public function getCount() - { - return \count($this->errors); - } - - public function assertOnlyOneDeprecatedError($deprecationMessage): void - { - $this->testCase->assertSame(1, $this->getCount()); - $this->testCase->assertSame(1, $this->getDeprecatedCount()); - $this->testCase->assertSame($deprecationMessage, $this->getMessage(0)); - } - - public function assertOnlyDeprecatedErrors(array $deprecationMessages): void - { - $this->testCase->assertSame(\count($deprecationMessages), $this->getCount()); - $this->testCase->assertSame(\count($deprecationMessages), $this->getDeprecatedCount()); - - foreach ($deprecationMessages as $index => $message) { - $this->testCase->assertSame($message, $this->getMessage($index)); - } - } - - public function getDeprecatedCount() - { - $count = 0; - - foreach ($this->errors as $error) { - if (\E_USER_DEPRECATED === $error[0]) { - ++$count; - } - } - - return $count; - } - - public function getType($index) - { - return $this->errors[$index][0]; - } - - public function getMessage($index) - { - return $this->errors[$index][1]; - } -}