<commit_before><?php
namespace Laravolt\Mural\Test;

use Illuminate\Database\Schema\Blueprint;
use Laravolt\Mural\Comment;
use Laravolt\Mural\Test\DummyPost;
use Laravolt\Mural\Test\DummyUser;
use Symfony\Component\DomCrawler\Crawler;

class MuralBootstrapTest extends TestCase
{
	protected function getEnvironmentSetUp($app)
    {
        $app['config']->set('database.default', 'sqlite');
        $app['config']->set('database.connections.sqlite', [
            'driver' => 'sqlite',
            'database' => __DIR__.'/database.sqlite',
            'prefix' => '',
        ]);
        $app['config']->set('mural.default_commentable', DummyPost::class);
        $app['config']->set('mural.default_commentator', DummyUser::class);
        $app['config']->set('mural.skin', 'bootstrap');
    }

	public function test_render_if_showing()
	{
		$post = DummyPost::find(1);
        $html = \Mural::render($post, 'test-room');
        $crawler = new Crawler($html);

        $this->assertEquals($crawler->filter('div[data-type = "Laravolt\Mural\Test\DummyPost"]')->count(), 1);
        $this->assertEquals($crawler->filter('div[data-room = "test-room"]')->count(), 1);
        $this->assertContains($crawler->filter('.author')->text(), 'Heru');
        $this->assertContains('ago', $crawler->filter('.date')->text());
        $this->assertContains('My Comment 2', $crawler->filter('.media-body p')->eq(0)->text());
        $this->assertContains('My Comment 1', $crawler->filter('.media-body p')->eq(1)->text());
<commit_msg>set config mural skin for tests<commit_after><?php
namespace Laravolt\Mural\Test;

use Illuminate\Database\Schema\Blueprint;
use Laravolt\Mural\Comment;
use Laravolt\Mural\Test\DummyPost;
use Laravolt\Mural\Test\DummyUser;
use Symfony\Component\DomCrawler\Crawler;

class MuralBootstrapTest extends TestCase
{
	protected function getEnvironmentSetUp($app)
    {
        parent::getEnvironmentSetUp($app);

        $app['config']->set('mural.skin', 'bootstrap');
    }

	public function test_render_if_showing()
	{
		$post = DummyPost::find(1);
        $html = \Mural::render($post, 'test-room');
        $crawler = new Crawler($html);

        $this->assertEquals($crawler->filter('div[data-type = "Laravolt\Mural\Test\DummyPost"]')->count(), 1);
        $this->assertEquals($crawler->filter('div[data-room = "test-room"]')->count(), 1);
        $this->assertContains($crawler->filter('.author')->text(), 'Heru');
        $this->assertContains('ago', $crawler->filter('.date')->text());
        $this->assertContains('My Comment 2', $crawler->filter('.media-body p')->eq(0)->text());
        $this->assertContains('My Comment 1', $crawler->filter('.media-body p')->eq(1)->text());

{'fraction_non_alphanumeric': 0.2011111111111111, 'fraction_numerical': 0.005185185185185185, 'mean_word_length': 4.115530303030303, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 52, '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': '1436862', 'n_tokens_mistral': 892, 'n_tokens_neox': 880, 'n_words': 124}