Skip to content

Commit 2e1b359

Browse files
Add missing test and add idea to gitignore
1 parent cc6d62b commit 2e1b359

10 files changed

+24
-1
lines changed

.gitignore

100755100644
+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/vendor
22
composer.phar
33
composer.lock
4-
.DS_Store
4+
.DS_Store
5+
/.idea

.travis.yml

100755100644
File mode changed.

composer.json

100755100644
File mode changed.

phpunit.xml

100755100644
File mode changed.

src/Danielboendergaard/Laravel4Multilanguage/Laravel4MultilanguageServiceProvider.php

100755100644
File mode changed.

src/Danielboendergaard/Laravel4Multilanguage/Router.php

100755100644
File mode changed.

src/Danielboendergaard/Laravel4Multilanguage/UrlGenerator.php

100755100644
File mode changed.

tests/.gitkeep

100755100644
File mode changed.

tests/RoutingTest.php

100755100644
File mode changed.

tests/RoutingUrlGeneratorTest.php

100755100644
+22
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,27 @@ public function tearDown()
1212
m::close();
1313
}
1414

15+
16+
public function testBasicUrlGeneration()
17+
{
18+
$gen = $this->getGenerator();
19+
$gen->setRequest(Request::create('http://foobar.com/foo/bar', 'GET'));
20+
21+
$this->assertEquals('http://foobar.com', $gen->to('/'));
22+
$this->assertEquals('http://foobar.com/something', $gen->to('/something'));
23+
$this->assertEquals('http://foobar.com/something', $gen->to('something'));
24+
25+
$this->assertEquals('https://foobar.com', $gen->secure('/'));
26+
$this->assertEquals('https://foobar.com/something', $gen->secure('/something'));
27+
$this->assertEquals('https://foobar.com/something', $gen->secure('something'));
28+
29+
$this->assertEquals('http://foobar.com/dayle/rees', $gen->to('/', array('dayle', 'rees')));
30+
$this->assertEquals('http://foobar.com/dayle/rees', $gen->to(null, array('dayle', 'rees')));
31+
$this->assertEquals('http://foobar.com/something/dayle/rees', $gen->to('/something', array('dayle', 'rees')));
32+
$this->assertEquals('http://foobar.com/something/dayle/rees', $gen->to('something', array('dayle', 'rees')));
33+
}
34+
35+
1536
public function testBasicMultilingualUrlGeneration()
1637
{
1738
$gen = $this->getMultilingualGenerator();
@@ -120,6 +141,7 @@ public function testUrlGeneratorUsesCurrentSchemeIfNoneSpecified()
120141
$this->assertEquals('https://dayle.com/', $gen->route('home'));
121142
}
122143

144+
123145
protected function getGenerator()
124146
{
125147
$router = new Router;

0 commit comments

Comments
 (0)