Skip to content

Commit

Permalink
Merge pull request #167 from einorler/SearchTests
Browse files Browse the repository at this point in the history
covered Search with tests
  • Loading branch information
saimaz committed Mar 29, 2016
2 parents 0488495 + b271491 commit 5c570a8
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions Tests/Unit/Search/SearchResponseTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?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\FilterManagerBundle\Tests\Unit\Search;

use ONGR\FilterManagerBundle\Search\SearchResponse;
use ONGR\ElasticsearchBundle\Result\DocumentIterator;
use ONGR\FilterManagerBundle\Tests\app\fixture\TestBundle\Document\Person;

class SearchResponseTest extends \PHPUnit_Framework_TestCase
{
/**
* Tests the response when $document does not implement
* SerializableInterface
*
* @expectedException \LogicException
*/
public function testGetSerializableDataException()
{
$filters = $this->getMock('NGR\FilterManagerBundle\Filter\ViewData');
$result = $this->getMockBuilder('ONGR\ElasticsearchBundle\Result\DocumentIterator')
->disableOriginalConstructor()
->getMock();
$result->expects($this->any())->method('valid')->will($this->returnValue(true));
$result->expects($this->any())->method('current')->will($this->returnValue(new \stdClass()));
$response = new SearchResponse($filters, $result, []);
$response->getSerializableData();
}
}

0 comments on commit 5c570a8

Please sign in to comment.