diff --git a/src/Bool/Bool.php b/src/Bool/Bool.php deleted file mode 100644 index f652842c08e623238e26a65f234d4e292907ebdf..0000000000000000000000000000000000000000 --- a/src/Bool/Bool.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php - -/* - * This file is part of the ONGR package. - * - * (c) NFQ Technologies UAB <info@nfq.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace ONGR\ElasticsearchDSL\Bool; - -use ONGR\ElasticsearchDSL\BuilderInterface; -use ONGR\ElasticsearchDSL\Query\BoolQuery; - -/** - * Bool operator. Can be used for filters and queries. - * - * @deprecated Will be removed in 1.0. Use ONGR\ElasticsearchDSL\Query\BoolQuery. - */ -class Bool extends BoolQuery -{ - /** - * Add BuilderInterface object to bool operator. - * - * @param BuilderInterface $bool - * @param string $type - * - * @throws \UnexpectedValueException - * - * @deprecated Will be removed in 1.0. Use ONGR\ElasticsearchDSL\Query\BoolQuery::add(). - */ - public function addToBool(BuilderInterface $bool, $type = BoolQuery::MUST) - { - $this->add($bool, $type); - } -} diff --git a/tests/Bool/BoolTest.php b/tests/Filter/BoolFilterTest.php similarity index 77% rename from tests/Bool/BoolTest.php rename to tests/Filter/BoolFilterTest.php index 521cd7fe190b2c3049814151530f315822c5dbd9..0c78e8e8c85f81c36f59c6741f99518ae092daa4 100644 --- a/tests/Bool/BoolTest.php +++ b/tests/Filter/BoolFilterTest.php @@ -11,23 +11,23 @@ namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Aggregation; -use ONGR\ElasticsearchDSL\Bool\Bool; +use ONGR\ElasticsearchDSL\Filter\BoolFilter; use ONGR\ElasticsearchDSL\Filter\MissingFilter; use ONGR\ElasticsearchDSL\Filter\TermFilter; /** * Unit test for Bool. */ -class BoolTest extends \PHPUnit_Framework_TestCase +class BoolFilterTest extends \PHPUnit_Framework_TestCase { /** * Tests isRelevant method. */ public function testBoolIsRelevant() { - $bool = new Bool(); + $bool = new BoolFilter(); $this->assertFalse($bool->isRelevant()); - $bool->addToBool(new MissingFilter('test')); + $bool->add(new MissingFilter('test')); $this->assertTrue($bool->isRelevant()); } @@ -39,8 +39,8 @@ class BoolTest extends \PHPUnit_Framework_TestCase */ public function testBoolAddToBoolException() { - $bool = new Bool(); - $bool->addToBool(new MissingFilter('test'), 'Should'); + $bool = new BoolFilter(); + $bool->add(new MissingFilter('test'), 'Should'); } /** @@ -48,10 +48,10 @@ class BoolTest extends \PHPUnit_Framework_TestCase */ public function testBoolToArray() { - $bool = new Bool(); - $bool->addToBool(new TermFilter('key1', 'value1'), 'should'); - $bool->addToBool(new TermFilter('key2', 'value2'), 'must'); - $bool->addToBool(new TermFilter('key3', 'value3'), 'must_not'); + $bool = new BoolFilter(); + $bool->add(new TermFilter('key1', 'value1'), 'should'); + $bool->add(new TermFilter('key2', 'value2'), 'must'); + $bool->add(new TermFilter('key3', 'value3'), 'must_not'); $expected = [ 'should' => [ [ @@ -83,7 +83,7 @@ class BoolTest extends \PHPUnit_Framework_TestCase */ public function testBoolGetType() { - $bool = new Bool(); + $bool = new BoolFilter(); $result = $bool->getType(); $this->assertEquals('bool', $result); }