summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2018-08-22 03:10:08 +0200
committerIgor Scheller <igor.scheller@igorshp.de>2018-08-22 03:10:08 +0200
commit73c9d923e7cc77847cfcbff4b90ad4815699a4fa (patch)
tree76000712338c18a37a433b365cd32a72de2b1805
parentb0e7bc0df2eb4975223582089c7a928903e8cd14 (diff)
Renamed RoutingServiceProvider to Http\UrlGeneratorServiceProvider
-rw-r--r--config/app.php2
-rw-r--r--src/Http/UrlGenerator.php (renamed from src/Routing/UrlGenerator.php)2
-rw-r--r--src/Http/UrlGeneratorServiceProvider.php (renamed from src/Routing/RoutingServiceProvider.php)6
-rw-r--r--src/helpers.php4
-rw-r--r--tests/Unit/HelpersTest.php4
-rw-r--r--tests/Unit/Http/UrlGeneratorServiceProviderTest.php (renamed from tests/Unit/Routing/RoutingServiceProviderTest.php)12
-rw-r--r--tests/Unit/Http/UrlGeneratorTest.php (renamed from tests/Unit/Routing/UrlGeneratorTest.php)4
7 files changed, 17 insertions, 17 deletions
diff --git a/config/app.php b/config/app.php
index bb405fde..6278f193 100644
--- a/config/app.php
+++ b/config/app.php
@@ -8,7 +8,7 @@ return [
\Engelsystem\Logger\LoggerServiceProvider::class,
\Engelsystem\Exceptions\ExceptionsServiceProvider::class,
\Engelsystem\Config\ConfigServiceProvider::class,
- \Engelsystem\Routing\RoutingServiceProvider::class,
+ \Engelsystem\Http\UrlGeneratorServiceProvider::class,
\Engelsystem\Renderer\RendererServiceProvider::class,
\Engelsystem\Database\DatabaseServiceProvider::class,
\Engelsystem\Http\RequestServiceProvider::class,
diff --git a/src/Routing/UrlGenerator.php b/src/Http/UrlGenerator.php
index 6df52425..132fefc7 100644
--- a/src/Routing/UrlGenerator.php
+++ b/src/Http/UrlGenerator.php
@@ -1,6 +1,6 @@
<?php
-namespace Engelsystem\Routing;
+namespace Engelsystem\Http;
class UrlGenerator
{
diff --git a/src/Routing/RoutingServiceProvider.php b/src/Http/UrlGeneratorServiceProvider.php
index b7db1383..37304076 100644
--- a/src/Routing/RoutingServiceProvider.php
+++ b/src/Http/UrlGeneratorServiceProvider.php
@@ -1,14 +1,14 @@
<?php
-namespace Engelsystem\Routing;
+namespace Engelsystem\Http;
use Engelsystem\Container\ServiceProvider;
-class RoutingServiceProvider extends ServiceProvider
+class UrlGeneratorServiceProvider extends ServiceProvider
{
public function register()
{
$urlGenerator = $this->app->make(UrlGenerator::class);
- $this->app->instance('routing.urlGenerator', $urlGenerator);
+ $this->app->instance('http.urlGenerator', $urlGenerator);
}
}
diff --git a/src/helpers.php b/src/helpers.php
index 01fb10bd..a90b2462 100644
--- a/src/helpers.php
+++ b/src/helpers.php
@@ -6,7 +6,7 @@ use Engelsystem\Config\Config;
use Engelsystem\Http\Request;
use Engelsystem\Http\Response;
use Engelsystem\Renderer\Renderer;
-use Engelsystem\Routing\UrlGenerator;
+use Engelsystem\Http\UrlGenerator;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
/**
@@ -125,7 +125,7 @@ function session($key = null, $default = null)
*/
function url($path = null, $parameters = [])
{
- $urlGenerator = app('routing.urlGenerator');
+ $urlGenerator = app('http.urlGenerator');
if (is_null($path)) {
return $urlGenerator;
diff --git a/tests/Unit/HelpersTest.php b/tests/Unit/HelpersTest.php
index 82030169..b59b11ee 100644
--- a/tests/Unit/HelpersTest.php
+++ b/tests/Unit/HelpersTest.php
@@ -8,7 +8,7 @@ use Engelsystem\Container\Container;
use Engelsystem\Http\Request;
use Engelsystem\Http\Response;
use Engelsystem\Renderer\Renderer;
-use Engelsystem\Routing\UrlGenerator;
+use Engelsystem\Http\UrlGenerator;
use PHPUnit\Framework\TestCase;
use PHPUnit_Framework_MockObject_MockObject as MockObject;
use Symfony\Component\HttpFoundation\Session\Session;
@@ -202,7 +202,7 @@ class HelpersTest extends TestCase
$urlGeneratorMock = $this->getMockBuilder(UrlGenerator::class)
->getMock();
- $this->getAppMock('routing.urlGenerator', $urlGeneratorMock);
+ $this->getAppMock('http.urlGenerator', $urlGeneratorMock);
$this->assertEquals($urlGeneratorMock, url());
$urlGeneratorMock->expects($this->once())
diff --git a/tests/Unit/Routing/RoutingServiceProviderTest.php b/tests/Unit/Http/UrlGeneratorServiceProviderTest.php
index dd9441eb..f3d5e018 100644
--- a/tests/Unit/Routing/RoutingServiceProviderTest.php
+++ b/tests/Unit/Http/UrlGeneratorServiceProviderTest.php
@@ -2,15 +2,15 @@
namespace Engelsystem\Test\Unit\Routing;
-use Engelsystem\Routing\RoutingServiceProvider;
-use Engelsystem\Routing\UrlGenerator;
+use Engelsystem\Http\UrlGenerator;
+use Engelsystem\Http\UrlGeneratorServiceProvider;
use Engelsystem\Test\Unit\ServiceProviderTest;
use PHPUnit_Framework_MockObject_MockObject;
-class RoutingServiceProviderTest extends ServiceProviderTest
+class UrlGeneratorServiceProviderTest extends ServiceProviderTest
{
/**
- * @covers \Engelsystem\Routing\RoutingServiceProvider::register()
+ * @covers \Engelsystem\Http\UrlGeneratorServiceProvider::register()
*/
public function testRegister()
{
@@ -21,9 +21,9 @@ class RoutingServiceProviderTest extends ServiceProviderTest
$app = $this->getApp();
$this->setExpects($app, 'make', [UrlGenerator::class], $urlGenerator);
- $this->setExpects($app, 'instance', ['routing.urlGenerator', $urlGenerator]);
+ $this->setExpects($app, 'instance', ['http.urlGenerator', $urlGenerator]);
- $serviceProvider = new RoutingServiceProvider($app);
+ $serviceProvider = new UrlGeneratorServiceProvider($app);
$serviceProvider->register();
}
}
diff --git a/tests/Unit/Routing/UrlGeneratorTest.php b/tests/Unit/Http/UrlGeneratorTest.php
index 6da59a4f..89ffa7dd 100644
--- a/tests/Unit/Routing/UrlGeneratorTest.php
+++ b/tests/Unit/Http/UrlGeneratorTest.php
@@ -5,7 +5,7 @@ namespace Engelsystem\Test\Unit\Routing;
use Engelsystem\Application;
use Engelsystem\Container\Container;
use Engelsystem\Http\Request;
-use Engelsystem\Routing\UrlGenerator;
+use Engelsystem\Http\UrlGenerator;
use PHPUnit\Framework\TestCase;
class UrlGeneratorTest extends TestCase
@@ -21,7 +21,7 @@ class UrlGeneratorTest extends TestCase
/**
* @dataProvider provideLinksTo
- * @covers \Engelsystem\Routing\UrlGenerator::to
+ * @covers \Engelsystem\Http\UrlGenerator::to
*
* @param string $path
* @param string $willReturn