-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added workaround for undefined services of symfony3 (#145)
Brought phpunit in dev dependencies to solve compatibility issues with travis Added symfony also for the prefer-lowest step
- Loading branch information
Showing
14 changed files
with
123 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
/Tests/app/cache | ||
/Tests/app/logs | ||
/vendor | ||
composer.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
namespace Liip\MonitorBundle\Tests\Helper; | ||
|
||
use Liip\MonitorBundle\Helper\PathHelper; | ||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; | ||
use Symfony\Component\HttpKernel\Kernel; | ||
|
||
class PathHelperTest extends WebTestCase | ||
{ | ||
public function testGenerateRoutes() | ||
{ | ||
if (Kernel::MAJOR_VERSION === '2' && Kernel::MINOR_VERSION === '7') { | ||
$environment = 'symfony27'; | ||
} else { | ||
$environment = 'symfony' . Kernel::MAJOR_VERSION; | ||
} | ||
|
||
$client = static::createClient(array('environment' => $environment)); | ||
|
||
$container = $client->getContainer(); | ||
|
||
$pathHelper = new PathHelper($container); | ||
|
||
// test route is defined in Tests/app/routing.yml | ||
$routes = $pathHelper->generateRoutes(['test_route' => []]); | ||
|
||
$this->assertEquals(['api.test_route = "/monitor";'], $routes); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
use Symfony\Component\HttpKernel\Kernel; | ||
use Symfony\Component\Config\Loader\LoaderInterface; | ||
|
||
/** | ||
* Class AppKernel | ||
*/ | ||
class AppKernel extends Kernel | ||
{ | ||
/** | ||
* @return array | ||
*/ | ||
public function registerBundles() | ||
{ | ||
return [ | ||
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), | ||
new Symfony\Bundle\TwigBundle\TwigBundle(), | ||
]; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function registerContainerConfiguration(LoaderInterface $loader) | ||
{ | ||
$loader->load(__DIR__ . '/config_' . $this->environment . '.yml'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# symfony 2 config (requires assets_base_urls for testing) | ||
framework: | ||
router: | ||
resource: "%kernel.root_dir%/routing.yml" | ||
secret: test | ||
templating: | ||
engines: ['twig'] | ||
assets_base_urls: { http: ["http://testurl"], ssl: ["http://testurl"] } | ||
test: ~ | ||
profiler: | ||
collect: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# symfony 2.7 config (no longer allows assets_base_urls) | ||
framework: | ||
router: | ||
resource: "%kernel.root_dir%/routing.yml" | ||
secret: test | ||
templating: | ||
engines: ['twig'] | ||
test: ~ | ||
profiler: | ||
collect: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# symfony 3 config (requires assets defined) | ||
framework: | ||
router: | ||
resource: "%kernel.root_dir%/routing.yml" | ||
secret: test | ||
templating: | ||
engines: ['twig'] | ||
test: ~ | ||
assets: ~ | ||
profiler: | ||
collect: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
test_route: | ||
path: "/monitor" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters