<commit_before><?php

namespace Oro\Bundle\ActionBundle\Tests\Unit\Model;

use Oro\Bundle\ActionBundle\Model\ButtonContext;
use Oro\Component\Testing\Unit\EntityTestCaseTrait;

class ButtonContextTest extends \PHPUnit_Framework_TestCase
{
    use EntityTestCaseTrait;

    /** @var  ButtonContext */
    protected $buttonContext;

    /**
     * {@inheritdoc}
     */
    public function setUp()
    {
        $this->buttonContext = new ButtonContext();
    }

    public function testGetSetButtonContext()
    {
        $context = [
            ['routeName', 'test_route'],
            ['datagridName', 'datagrid'],
            ['group', 'test_group'],
            ['executionUrl', 'test_url1'],
            ['dialogUrl', 'test_url2'],
            ['enabled', true]
        ];

        $this->assertPropertyAccessors($this->buttonContext, $context);
    }

    public function testSetGetEntity()
    {
        $this->buttonContext->setEntity('Class', 10);
        $this->assertSame('Class', $this->buttonContext->getEntityClass());
        $this->assertSame(10, $this->buttonContext->getEntityId());
    }
}
<commit_msg>BAP-12467: Add ButtonContext Class - updated test<commit_after><?php

namespace Oro\Bundle\ActionBundle\Tests\Unit\Model;

use Oro\Bundle\ActionBundle\Model\ButtonContext;
use Oro\Component\Testing\Unit\EntityTestCaseTrait;

class ButtonContextTest extends \PHPUnit_Framework_TestCase
{
    use EntityTestCaseTrait;

    /** @var  ButtonContext */
    protected $buttonContext;

    /**
     * {@inheritdoc}
     */
    public function setUp()
    {
        $this->buttonContext = new ButtonContext();
    }

    public function testGetSetButtonContext()
    {
        $context = [
            ['routeName', 'test_route'],
            ['datagridName', 'datagrid'],
            ['group', 'test_group'],
            ['executionUrl', 'test_url1'],
            ['dialogUrl', 'test_url2'],
            ['enabled', true],
            ['unavailableHidden', true]
        ];

        $this->assertPropertyAccessors($this->buttonContext, $context);
    }

    public function testSetGetEntity()
    {
        $this->buttonContext->setEntity('Class', 10);
        $this->assertSame('Class', $this->buttonContext->getEntityClass());
        $this->assertSame(10, $this->buttonContext->getEntityId());
    }
}

{'fraction_non_alphanumeric': 0.14445881845623113, 'fraction_numerical': 0.007330746011211729, 'mean_word_length': 2.772357723577236, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 25, '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': '2370146', 'n_tokens_mistral': 677, 'n_tokens_neox': 657, 'n_words': 109}