summaryrefslogtreecommitdiff
path: root/vendor/ruflin/elastica/test/lib/Elastica/Test/Filter/TypeTest.php
blob: fcada826a889c1b28c0be735b0ccb82af1667cb9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php

namespace Elastica\Test\Filter;

use Elastica\Filter\Type;
use Elastica\Test\Base as BaseTest;

class TypeTest extends BaseTest
{
    public function testSetType()
    {
        $typeFilter = new Type();
        $returnValue = $typeFilter->setType('type_name');
        $this->assertInstanceOf('Elastica\Filter\Type', $returnValue);
    }

    public function testToArray()
    {
        $typeFilter = new Type('type_name');

        $expectedArray = array(
            'type' => array('value' => 'type_name')
        );

        $this->assertEquals($expectedArray, $typeFilter->toArray());
    }
}