<commit_before><?php

namespace Oro\Bundle\NotificationBundle\Tests\Unit\Entity;

use Oro\Bundle\NotificationBundle\Entity\MassNotification;

class MassNotificationTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @var MassNotification
     */
    protected $massNotification;

    protected function setUp()
    {
        $this->massNotification = new MassNotification();

        // get id should return null cause this entity was not loaded from DB
        $this->assertNull($this->massNotification->getId());
    }

    protected function tearDown()
    {
        unset($this->massNotification);
    }
    
    /**
     * @dataProvider getSetDataProvider
     */
    public function testGetSet($property, $value, $expected)
    {
        call_user_func_array(array($this->massNotification, 'set' . ucfirst($property)), array($value));
        $this->assertEquals(
            $expected,
            call_user_func_array(array($this->massNotification, 'get' . ucfirst($property)), array())
        );
    }

    /**
     * @return array
     */
    public function getSetDataProvider()
    {
        $date = new \DateTime('now');
        $message = $this->getMock('Swift_Mime_Message');
        return [
            'email'       => ['email', '<EMAIL>', '<EMAIL>'],
            'body'        => ['body', 'test body', 'test body'],
            'title'       => ['title', 'test title', 'test title'],
            'scheduledAt' => ['scheduledAt', $date, $date],
            'processedAt' => ['processedAt', $date, $date],
            'status'      => ['status', 1, 1],
            'message'     => ['message', $message, $message]
        ];
    }
}<commit_msg>BAP-10515, BAP-10504: Send mass notifications to application users  - update unit test<commit_after><?php

namespace Oro\Bundle\NotificationBundle\Tests\Unit\Entity;

use Oro\Bundle\NotificationBundle\Entity\MassNotification;

class MassNotificationTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @var MassNotification
     */
    protected $massNotification;

    protected function setUp()
    {
        $this->massNotification = new MassNotification();

        // get id should return null cause this entity was not loaded from DB
        $this->assertNull($this->massNotification->getId());
    }

    protected function tearDown()
    {
        unset($this->massNotification);
    }
    
    /**
     * @dataProvider getSetDataProvider
     */
    public function testGetSet($property, $value, $expected)
    {
        call_user_func_array(array($this->massNotification, 'set' . ucfirst($property)), array($value));
        $this->assertEquals(
            $expected,
            call_user_func_array(array($this->massNotification, 'get' . ucfirst($property)), array())
        );
    }

    /**
     * @return array
     */
    public function getSetDataProvider()
    {
        $date = new \DateTime('now');
        $message = $this->getMock('Swift_Mime_Message');
        return [
            'email'       => ['email', '<EMAIL>', '<EMAIL>'],
            'from'        => ['from', '<EMAIL>', '<EMAIL>'],
            'body'        => ['body', 'test body', 'test body'],
            'title'       => ['title', 'test title', 'test title'],
            'scheduledAt' => ['scheduledAt', $date, $date],
            'processedAt' => ['processedAt', $date, $date],
            'status'      => ['status', 1, 1],
            'message'     => ['message', $message, $message]
        ];
    }
}
{'fraction_non_alphanumeric': 0.15331412103746397, 'fraction_numerical': 0.004034582132564841, 'mean_word_length': 2.3962818003913893, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 42, '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': '3959171', 'n_tokens_mistral': 981, 'n_tokens_neox': 961, 'n_words': 208}