I think you misunderstood me. Instead of create the class `SxGeo` in constructor, you can simply inject it.

```diff
- public function __construct($dbFile, $flags = null, $countryOnly = false)
+ public function __construct(SxGeo $object)
{
-        // trigger autoload
-        class_exists('SxGeo');
-        if (null === $flags) {
-            $flags = SXGEO_FILE;
-        }
-        $this->sypex = new \SxGeo($dbFile, $flags);
-        $this->countryOnly = $countryOnly;
+       $this->object = $object;
}

Now you can test this class easier and you haven't problems with autoloading.