Moved logic to create a visitor from a request to the visitor itself

This commit is contained in:
Alejandro Celaya
2018-10-18 20:24:25 +02:00
parent 545094cddf
commit 44f0011445
5 changed files with 18 additions and 11 deletions

View File

@@ -6,6 +6,7 @@ namespace ShlinkioTest\Shlink\Common\Middleware;
use PHPUnit\Framework\TestCase;
use ReflectionObject;
use Shlinkio\Shlink\Common\Middleware\IpAddressMiddlewareFactory;
use Shlinkio\Shlink\Core\Model\Visitor;
use Zend\ServiceManager\ServiceManager;
class IpAddressMiddlewareFactoryTest extends TestCase
@@ -34,6 +35,6 @@ class IpAddressMiddlewareFactoryTest extends TestCase
$this->assertTrue($checkProxyHeaders->getValue($instance));
$this->assertEquals([], $trustedProxies->getValue($instance));
$this->assertEquals(IpAddressMiddlewareFactory::REMOTE_ADDRESS, $attributeName->getValue($instance));
$this->assertEquals(Visitor::REMOTE_ADDRESS_ATTR, $attributeName->getValue($instance));
}
}