<commit_before><?php

/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 cc=80; */

/**
 * @package     omeka
 * @subpackage  solr-search
 * @copyright   2012 Rector and Board of Visitors, University of Virginia
 * @license     http://www.apache.org/licenses/LICENSE-2.0.html
 */


class SolrSearch_Addon_Indexer_Test extends SolrSearch_Test_AppTestCase
{

    public function setUp()
    {

        parent::setUp();
        $this->setUpExhibitBuilder();
        $this->setUpSimplePages();

        try {
            // This blows up for some strange reason the first time it's run.
            $this->loadModels();
        } catch (Exception $e) {}

        $this->mgr = new SolrSearch_Addon_Manager($this->db);
        $addons = $this->mgr->parseAll();
        $this->exhibits = $addons['exhibits'];

        $this->idxr = new SolrSearch_Addon_Indexer($this->db);
    }

    public function testExhibitBuilderInstalled()
    {
        $table = $this->db->getTable('Exhibit');
        $this->assertNotNull($table);

        $tables = $this->db->fetchAssoc('SHOW TABLES;');
        $this->assertArrayHasKey('omeka_exhibits', $tables);

        $rows = $table->findAll();
        $this->assertNotEmpty($rows);
    }<commit_msg>Gets rid of uneeded try/catch block around loadModels in SolrSearch_Addon_Indexer_Test.<commit_after><?php

/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 cc=80; */

/**
 * @package     omeka
 * @subpackage  solr-search
 * @copyright   2012 Rector and Board of Visitors, University of Virginia
 * @license     http://www.apache.org/licenses/LICENSE-2.0.html
 */


class SolrSearch_Addon_Indexer_Test extends SolrSearch_Test_AppTestCase
{

    public function setUp()
    {

        parent::setUp();
        $this->setUpExhibitBuilder();
        $this->setUpSimplePages();
        $this->loadModels();

        $this->mgr = new SolrSearch_Addon_Manager($this->db);
        $addons = $this->mgr->parseAll();
        $this->exhibits = $addons['exhibits'];

        $this->idxr = new SolrSearch_Addon_Indexer($this->db);
    }

    public function testExhibitBuilderInstalled()
    {
        $table = $this->db->getTable('Exhibit');
        $this->assertNotNull($table);

        $tables = $this->db->fetchAssoc('SHOW TABLES;');
        $this->assertArrayHasKey('omeka_exhibits', $tables);

        $rows = $table->findAll();
        $this->assertNotEmpty($rows);
    }
{'fraction_non_alphanumeric': 0.14558274574865201, 'fraction_numerical': 0.009124844462878473, 'mean_word_length': 2.9283387622149837, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '6429880', 'n_tokens_mistral': 794, 'n_tokens_neox': 762, 'n_words': 143}