<commit_before><?php
/**
 * @package syrup-component-bundle
 * @copyright 2015 Keboola
 * @author <NAME> <<EMAIL>>
 */

namespace Keboola\Syrup\Tests\Elasticsearch;

use Keboola\Syrup\Elasticsearch\ComponentIndex;
use Keboola\Syrup\Elasticsearch\IndexNameResolver;

class IndexNameResolverTest extends \PHPUnit_Framework_TestCase
{


    /**
     * @covers \Keboola\Syrup\Elasticsearch\IndexNameResolver::buildMapping
     */
    public function testMapping()
    {
        $mapping = ComponentIndex::buildMapping(__DIR__.'/../../../../app');
        $this->assertNotNull($mapping);
        $this->assertArrayHasKey('mappings', $mapping);
        $this->assertArrayHasKey('jobs', $mapping['mappings']);
        $this->assertArrayHasKey('properties', $mapping['mappings']['jobs']);
    }

    /**
     * @covers \Keboola\Syrup\Elasticsearch\IndexNameResolver::getYearFromIndexName
     */
    public function testGetYearFromIndexName()
    {
        $this->assertEquals(2014, IndexNameResolver::getYearFromIndexName('prod_syrup_ex-twitter_2014_7'));
    }

    /**
     * @covers \Keboola\Syrup\Elasticsearch\IndexNameResolver::getVersionFromIndexName
     */
    public function testGetVersionFromIndexName()
    {
        $this->assertEquals(7, IndexNameResolver::getVersionFromIndexName('prod_syrup_ex-twitter_2014_7'));
    }<commit_msg>test: fix coverage info<commit_after><?php
/**
 * @package syrup-component-bundle
 * @copyright 2015 Keboola
 * @author <NAME> <<EMAIL>>
 */

namespace Keboola\Syrup\Tests\Elasticsearch;

use Keboola\Syrup\Elasticsearch\IndexNameResolver;

class IndexNameResolverTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @covers \Keboola\Syrup\Elasticsearch\IndexNameResolver::getYearFromIndexName
     */
    public function testGetYearFromIndexName()
    {
        $this->assertEquals(2014, IndexNameResolver::getYearFromIndexName('prod_syrup_ex-twitter_2014_7'));
    }

    /**
     * @covers \Keboola\Syrup\Elasticsearch\IndexNameResolver::getVersionFromIndexName
     */
    public function testGetVersionFromIndexName()
    {
        $this->assertEquals(7, IndexNameResolver::getVersionFromIndexName('prod_syrup_ex-twitter_2014_7'));
    }
{'fraction_non_alphanumeric': 0.13083257090576395, 'fraction_numerical': 0.01738334858188472, 'mean_word_length': 4.207142857142857, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6077449', 'n_tokens_mistral': 696, 'n_tokens_neox': 685, 'n_words': 81}