<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 SolrSearchPluginTest_ExhibitPages extends SolrSearch_Test_AppTestCase
{


    /**
     * Install Exhibit Builder or skip the suite.
     */
    public function setUp()
    {
        parent::setUp();
        $this->_installPluginOrSkip('ExhibitBuilder');
    }


    /**
     * When a page is added to a public exhibit, it should be indexed in Solr.
     */
    public function testIndexNewPageInPublicExhibit()
    {

        // Add a public exhibit.
        $exhibit = $this->_exhibit(true);

        // Add a page to the exhibit.
        $page = $this->_exhibitPage($exhibit);

        // Should add a Solr document.
        $this->_assertRecordInSolr($page);

    }


    /**
     * When an existing exhibit is switched from private to public, a page in
     * the exhibit should be indexed in Solr.
     * @group pages
     */
    public function testIndexPageWhenExhibitSetPublic()
    {

        // Add a private exhibit.
        $exhibit = $this->_exhibit(false);

        // Add a page to the exhibit.
        $page = $this->_exhibitPage($exhibit);

        // Set exhibit public.
        $exhibit->public = true;
        $exhibit->save();<commit_msg>Adds/implements a resaveChildren method on the addons manager.<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 SolrSearchPluginTest_ExhibitPages extends SolrSearch_Test_AppTestCase
{


    /**
     * Install Exhibit Builder or skip the suite.
     */
    public function setUp()
    {
        parent::setUp();
        $this->_installPluginOrSkip('ExhibitBuilder');
    }


    /**
     * When a page is added to a public exhibit, it should be indexed in Solr.
     */
    public function testIndexNewPageInPublicExhibit()
    {

        // Add a public exhibit.
        $exhibit = $this->_exhibit(true);

        // Add a page to the exhibit.
        $page = $this->_exhibitPage($exhibit);

        // Should add a Solr document.
        $this->_assertRecordInSolr($page);

    }


    /**
     * When an existing exhibit is switched from private to public, a page in
     * the exhibit should be indexed in Solr.
     */
    public function testIndexPageWhenExhibitSetPublic()
    {

        // Add a private exhibit.
        $exhibit = $this->_exhibit(false);

        // Add a page to the exhibit.
        $page = $this->_exhibitPage($exhibit);

        // Set exhibit public.
        $exhibit->public = true;
        $exhibit->save();
{'fraction_non_alphanumeric': 0.10963568266939054, 'fraction_numerical': 0.00749063670411985, 'mean_word_length': 2.3085585585585586, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, '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': '3834271', 'n_tokens_mistral': 913, 'n_tokens_neox': 842, 'n_words': 250}