<commit_before><?php
namespace Test\Statsd\Client;

class SocketConnectionTest extends \PHPUnit_Framework_TestCase
{
    public function testObject()
    {
        $sc = new \Statsd\Client\SocketConnection(
            array(
                'host' => '127.0.0.1',
                'port' => '8125',
                'throw_exception' => false,
            )
        );
    }

    public function testSuccessfulSendMessage()
    {
        $sc = new \Statsd\Client\SocketConnection();
        $this->assertEquals(
            6,
            $sc->send("123456")
        );
    }

    public function testFailSendMessage()
    {
        $sc = new \Statsd\Client\SocketConnection(
            array(
                'host' => 'host-foo.bar',
            )
        );
        $this->assertEquals(
            0,
            $sc->send("123456")
        );
    }

    /**
     * @expectedException Exception
     * @expectedExceptionMessage failed
     */
    public function testExceptioOpenSocket()
    {<commit_msg>Mark SocketConnectionTest::testExceptioOpenSocket() skipped<commit_after><?php
namespace Test\Statsd\Client;

class SocketConnectionTest extends \PHPUnit_Framework_TestCase
{
    public function testObject()
    {
        $sc = new \Statsd\Client\SocketConnection(
            array(
                'host' => '127.0.0.1',
                'port' => '8125',
                'throw_exception' => false,
            )
        );
    }

    public function testSuccessfulSendMessage()
    {
        $sc = new \Statsd\Client\SocketConnection();
        $this->assertEquals(
            6,
            $sc->send("123456")
        );
    }

    public function testFailSendMessage()
    {
        $sc = new \Statsd\Client\SocketConnection(
            array(
                'host' => 'host-foo.bar',
            )
        );
        $this->assertEquals(
            0,
            $sc->send("123456")
        );
    }

    /**
     * @expectedException Exception
     * @expectedExceptionMessage failed
     */
    public function testExceptioOpenSocket()
    {
        $this->markTestSkipped(
            "Throwing exceptions on socket connection is not consistent between HHVM and PHP"
            . "Even PHP documentation says detecting connection errors is not gruaranteed for UDP sockets"
        );
{'fraction_non_alphanumeric': 0.11135181975736569, 'fraction_numerical': 0.02079722703639515, 'mean_word_length': 1.6817653890824622, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 20, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '7311786', 'n_tokens_mistral': 658, 'n_tokens_neox': 616, 'n_words': 124}