<commit_before><?php

namespace Plastyk\Dashboard\Tests;

use Plastyk\Dashboard\Admin\DashboardAdmin;
use SilverStripe\Dev\SapphireTest;
use SilverStripe\Security\Member;

class DashboardAdminTest extends SapphireTest
{
    protected static $fixture_file = 'DashboardAdminTest.yml';

    protected $usesDatabase = true;

    protected function setUp()
    {
        DashboardAdmin::create();

        parent::setUp();
    }

    protected function tearDown()
    {
        parent::tearDown();
    }

    public function testPermission()
    {
        $dashboardAdmin = DashboardAdmin::create();

        $permittedUser = $this->objFromFixture(Member::class, 'user1');
        $this->logInAs($permittedUser);
        $this->assertTrue($dashboardAdmin->canView());

        $nonPermittedUser = $this->objFromFixture(Member::class, 'user2');
        $this->logInAs($nonPermittedUser);
        $this->assertFalse($dashboardAdmin->canView());
    }
}<commit_msg>Let's see if we need this anymore.<commit_after><?php

namespace Plastyk\Dashboard\Tests;

use Plastyk\Dashboard\Admin\DashboardAdmin;
use SilverStripe\Dev\SapphireTest;
use SilverStripe\Security\Member;

class DashboardAdminTest extends SapphireTest
{
    protected static $fixture_file = 'DashboardAdminTest.yml';

    public function testPermission()
    {
        $dashboardAdmin = DashboardAdmin::create();

        $permittedUser = $this->objFromFixture(Member::class, 'user1');
        $this->logInAs($permittedUser);
        $this->assertTrue($dashboardAdmin->canView());

        $nonPermittedUser = $this->objFromFixture(Member::class, 'user2');
        $this->logInAs($nonPermittedUser);
        $this->assertFalse($dashboardAdmin->canView());
    }
}
{'fraction_non_alphanumeric': 0.1314717859220477, 'fraction_numerical': 0.002326934264107039, 'mean_word_length': 3.9002849002849005, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, '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': '5804605', 'n_tokens_mistral': 527, 'n_tokens_neox': 527, 'n_words': 82}