<commit_before><?php

use Clue\React\Ami\Protocol\Action;

class ActionTest extends TestCase
{
    public function testIdDefaultsToNull()
    {
        $action = new Action();

        $this->assertNull($action->getActionId());
    }

    public function testIdCanBeSet()
    {
        $action = new Action(array('ActionID' => '123'));

        $this->assertEquals('123', $action->getActionId());
    }

    public function testSerializeSimple()
    {
        $action = new Action(array('Action' => 'name'));

        $this->assertEquals("Action: name\r\n\r\n", $action->getMessageSerialized());
    }

    public function testSerializeKeySingle()
    {
        $action = new Action(array('Action' => 'name', 'Key' => 'Value'));

        $this->assertEquals("Action: name\r\nKey: Value\r\n\r\n", $action->getMessageSerialized());
    }

    public function testSerializeKeyMultipleValues()
    {
        $action = new Action(array('Action' => 'name', 'Key' => array('Value1', 'Value2')));

        $this->assertEquals("Action: name\r\nKey: Value1\r\nKey: Value2\r\n\r\n", $action->getMessageSerialized());
    }

    public function testSerializeKeyMultipleKeyValues()
    {
        $action = new Action(array('Action' => 'name', 'Variables' => array('first' => 'on', 'second' => 'off')));

        $this->assertEquals("Action: name\r\nVariables: first=on\r\nVariables: second=off\r\n\r\n", $action->getMessageSerialized());
    }
}<commit_msg>Simplify testing Action fields<commit_after><?php

use Clue\React\Ami\Protocol\Action;

class ActionTest extends TestCase
{
    public function testIdDefaultsToNull()
    {
        $action = new Action();

        $this->assertNull($action->getActionId());
    }

    public function testIdCanBeSet()
    {
        $action = new Action(array('ActionID' => '123'));

        $this->assertEquals('123', $action->getActionId());
    }

    public function testOneFieldValue()
    {
        $action = new Action(array('Action' => 'name'));

        $this->assertEquals("Action: name\r\n\r\n", $action->getMessageSerialized());
    }

    public function testMultipleFieldsSingleValue()
    {
        $action = new Action(array('Action' => 'name', 'Key' => 'Value'));

        $this->assertEquals("Action: name\r\nKey: Value\r\n\r\n", $action->getMessageSerialized());
    }

    public function testOneFieldMultipleValues()
    {
        $action = new Action(array('Key' => array('Value1', 'Value2')));

        $this->assertEquals("Key: Value1\r\nKey: Value2\r\n\r\n", $action->getMessageSerialized());
    }

    public function testOneFieldMultipleKeyValues()
    {
        $action = new Action(array('Variables' => array('first' => 'on', 'second' => 'off')));

        $this->assertEquals("Variables: first=on\r\nVariables: second=off\r\n\r\n", $action->getMessageSerialized());
    }
}
{'fraction_non_alphanumeric': 0.17879858657243816, 'fraction_numerical': 0.007067137809187279, 'mean_word_length': 3.3420245398773005, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 45, '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': '7033099', 'n_tokens_mistral': 882, 'n_tokens_neox': 862, 'n_words': 153}