<?php

namespace Indigo\Supervisor\Test\Connector;

use Indigo\Supervisor\Connector\UnixSocketConnector;

/**
 * @coversDefaultClass \Indigo\Supervisor\Connector\UnixSocketConnector
 */
class UnixSocketConnectorTest extends SocketConnectorTest
{
    public function setUp()
    {
        try {
            $this->connector = new UnixSocketConnector($GLOBALS['socket']);
        } catch (\RuntimeException $e) {
            $this->markTestSkipped(
                'Supervisor is not available.'
            );
        }
    }

    /**
     * @covers ::__construct
     * @covers ::isConnected
     * @group  Supervisor
     */
    public function testInstance()
    {
        $connector = new UnixSocketConnector($GLOBALS['socket']);

        $this->assertInstanceOf(
            'Indigo\\Supervisor\\Connector\\UnixSocketConnector',
            $connector
        );

        $this->assertTrue($this->connector->isConnected());
    }
}

<?php

namespace Indigo\Supervisor\Test\Connector;

use Indigo\Supervisor\Connector\UnixSocketConnector;

/**
 * @coversDefaultClass \Indigo\Supervisor\Connector\UnixSocketConnector
 */
class UnixSocketConnectorTest extends SocketConnectorTest
{
    public function setUp()
    {
        $this->connector = new UnixSocketConnector($GLOBALS['socket']);

        if (!$this->connector->isConnected()) {
            $this->markTestSkipped(
                'Supervisor is not available.'
            );
        }
    }

    /**
     * @covers ::__construct
     * @covers ::isConnected
     * @group  Supervisor
     */
    public function testInstance()
    {
        $connector = new UnixSocketConnector($GLOBALS['socket']);

        $this->assertInstanceOf(
            'Indigo\\Supervisor\\Connector\\UnixSocketConnector',
            $connector
        );

        $this->assertTrue($this->connector->isConnected());
    }
}

--- 
+++ 
@@ -11,9 +11,9 @@
 {
     public function setUp()
     {
-        $this->connector = new UnixSocketConnector($GLOBALS['socket']);
-
-        if (!$this->connector->isConnected()) {
+        try {
+            $this->connector = new UnixSocketConnector($GLOBALS['socket']);
+        } catch (\RuntimeException $e) {
             $this->markTestSkipped(
                 'Supervisor is not available.'
             );
Make sure there is a connection before testing
