Commit fda721a3 authored by Tino Goratsch's avatar Tino Goratsch

fixed the PrefixUri class and covered it with unit tests

parent ae2d5e6f
<?php
/**
* Copyright (c) 2016 by the ACP3 Developers.
* See the LICENCE file at the top-level module directory for licencing details.
*/
namespace ACP3\Core\Test\View\Renderer\Smarty\Modifiers;
use ACP3\Core\View\Renderer\Smarty\Modifiers\PrefixUri;
class PrefixUriTest extends \PHPUnit_Framework_TestCase
{
/**
* @var PrefixUri
*/
private $prefixUri;
protected function setUp()
{
$this->prefixUri = new PrefixUri();
}
public function testAddUriPrefix()
{
$value = 'www.example.com';
$expected = 'http://www.example.com';
$this->assertEquals($expected, $this->prefixUri->process($value));
}
public function testAddUriPrefixNotNeeded()
{
$value = 'http://www.example.com';
$expected = 'http://www.example.com';
$this->assertEquals($expected, $this->prefixUri->process($value));
}
}
......@@ -29,6 +29,6 @@ class PrefixUri extends AbstractModifier
return 'http://' . $value;
}
return '';
return $value;
}
}
......@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Changed
### Fixed
- fixed the PrefixUri class when there is an URL given with a valid protocol
## [4.1.30] - 2016-10-27
### Added
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment