This repository has been archived by the owner on Nov 20, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure our bundle works with SF 4.2 (#82)
* Ensure our bundle works with SF 4.2 * Travis should also check on 7.2 * The templates should stay in Resources/views * Ignore deprecation from PHPUnit We still support SF3.3 and would need to do a major to change the current logic * FIX: Issue with phpdocumentor/type-resolver * FIX: composer.json incorrectl formatted
- Loading branch information
1 parent
f702295
commit e12840f
Showing
21 changed files
with
157 additions
and
65 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
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
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,41 @@ | ||
<?php | ||
/** | ||
* @copyright 2017-present Hostnet B.V. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Hostnet\Tests; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
use Symfony\Component\Config\Definition\Builder\NodeDefinition; | ||
use Symfony\Component\Config\Definition\Builder\TreeBuilder; | ||
use Symfony\Component\HttpKernel\Kernel; | ||
|
||
class AbstractTestCase extends TestCase | ||
{ | ||
protected function createTreeBuilder(string $config_root): TreeBuilder | ||
{ | ||
if (Kernel::VERSION_ID >= 40200) { | ||
return new TreeBuilder($config_root); | ||
} | ||
|
||
if (Kernel::VERSION_ID >= 30300 && Kernel::VERSION_ID < 40200) { | ||
return new TreeBuilder(); | ||
} | ||
|
||
throw new \RuntimeException('This bundle can only be used by Symfony 3.3 and up.'); | ||
} | ||
|
||
protected function retrieveRootNode(TreeBuilder $tree_builder, string $config_root): NodeDefinition | ||
{ | ||
if (Kernel::VERSION_ID >= 40200) { | ||
return $tree_builder->getRootNode(); | ||
} | ||
|
||
if (Kernel::VERSION_ID >= 30300 && Kernel::VERSION_ID < 40200) { | ||
return $tree_builder->root($config_root); | ||
} | ||
|
||
throw new \RuntimeException('This bundle can only be used by Symfony 3.3 and up.'); | ||
} | ||
} |
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
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
Oops, something went wrong.