diff --git a/tests/Unit/ConnectionTest.php b/tests/Unit/ConnectionTest.php
index <HASH>..<HASH> 100644
--- a/tests/Unit/ConnectionTest.php
+++ b/tests/Unit/ConnectionTest.php
@@ -62,7 +62,7 @@ class ConnectionTest extends \PHPUnit_Framework_TestCase
         $options = new ConnectionOptions();
         if (!self::$isGnatsd) {
             time_nanosleep(1, 700000000);
-            $options->port = 4222;
+            $options->setPort(4222);
         }
         $this->c = new Nats\Connection($options);
         $this->c->connect();
Fixed a broken unit test. Changed direct variable assignation to a setter