From 792d5a20bcb4926c91311afced67ddd008c3b79e Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Wed, 30 Sep 2015 22:21:35 -0400 Subject: Make sure there is always a trailing slash for application_url --- tests/units/Model/ConfigTest.php | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'tests/units/Model/ConfigTest.php') diff --git a/tests/units/Model/ConfigTest.php b/tests/units/Model/ConfigTest.php index c0ed0313..832575b8 100644 --- a/tests/units/Model/ConfigTest.php +++ b/tests/units/Model/ConfigTest.php @@ -7,6 +7,20 @@ use Core\Session; class ConfigTest extends Base { + public function testSaveApplicationUrl() + { + $c = new Config($this->container); + + $this->assertTrue($c->save(array('application_url' => 'http://localhost/'))); + $this->assertEquals('http://localhost/', $c->get('application_url')); + + $this->assertTrue($c->save(array('application_url' => 'http://localhost'))); + $this->assertEquals('http://localhost/', $c->get('application_url')); + + $this->assertTrue($c->save(array('application_url' => ''))); + $this->assertEquals('', $c->get('application_url')); + } + public function testDefaultValues() { $c = new Config($this->container); @@ -56,11 +70,4 @@ class ConfigTest extends Base session_id(''); unset($this->container['session']); } - - public function testSave() - { - $c = new Config($this->container); - $this->assertTrue($c->save(array('application_url' => 'http://localhost/'))); - $this->assertEquals('http://localhost/', $c->get('application_url')); - } } -- cgit v1.2.3