FOSElasticaBundle/Tests/Functional/ConfigurationManagerTest.php

60 lines
1.4 KiB
PHP
Raw Normal View History

2014-06-16 15:23:49 +02:00
<?php
/**
* This file is part of the FOSElasticaBundle project.
*
* (c) Tim Nagel <tim@nagel.com.au>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace FOS\ElasticaBundle\Tests\Functional;
use Symfony\Bundle\FrameworkBundle\Client;
/**
* @group functional
*/
class ConfigurationManagerTest extends WebTestCase
{
public function testContainerSource()
{
$client = $this->createClient(array('test_case' => 'Basic'));
$manager = $this->getManager($client);
$index = $manager->getIndexConfiguration('index');
2014-06-17 15:22:58 +02:00
$this->assertEquals('index', $index->getName());
$this->assertGreaterThanOrEqual(2, count($index->getTypes()));
2014-06-17 15:22:58 +02:00
$this->assertInstanceOf('FOS\\ElasticaBundle\\Configuration\\TypeConfig', $index->getType('type'));
$this->assertInstanceOf('FOS\\ElasticaBundle\\Configuration\\TypeConfig', $index->getType('parent'));
2014-06-16 15:23:49 +02:00
}
protected function setUp()
{
parent::setUp();
$this->deleteTmpDir('Basic');
}
protected function tearDown()
{
parent::tearDown();
$this->deleteTmpDir('Basic');
}
/**
* @param Client $client
2015-03-12 11:20:00 +01:00
*
2014-06-18 08:47:01 +02:00
* @return \FOS\ElasticaBundle\Configuration\ConfigManager
2014-06-16 15:23:49 +02:00
*/
private function getManager(Client $client)
{
$manager = $client->getContainer()->get('fos_elastica.config_manager');
return $manager;
}
}