public function testCreateIcmp4() { try { $socket = $this->factory->createIcmp4(); } catch (Exception $e) { if ($e->getCode() === SOCKET_EPERM) { // skip if not root return $this->markTestSkipped('No access to ICMPv4 socket (only root can do so)'); } throw $e; } $this->assertInstanceOf('Socket\\Raw\\Socket', $socket); }