Commit 8e11cfa5 authored by Victor's avatar Victor

[Tests] Make use of the @requires annotation for PHP version

parent 1e0dd622
......@@ -18,15 +18,13 @@ use Silex\Provider\FormServiceProvider;
* FormTrait test cases.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @requires PHP 5.4
*/
class FormTraitTest extends \PHPUnit_Framework_TestCase
{
public function setUp()
{
if (version_compare(phpversion(), '5.4.0', '<')) {
$this->markTestSkipped('PHP 5.4 is required for this test');
}
if (!is_dir(__DIR__.'/../../../../vendor/symfony/form')) {
$this->markTestSkipped('Form dependency was not installed.');
}
......
......@@ -20,15 +20,13 @@ use Monolog\Logger;
* MonologTrait test cases.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @requires PHP 5.4
*/
class MonologTraitTest extends \PHPUnit_Framework_TestCase
{
public function setUp()
{
if (version_compare(phpversion(), '5.4.0', '<')) {
$this->markTestSkipped('PHP 5.4 is required for this test');
}
if (!is_dir(__DIR__.'/../../../../vendor/monolog/monolog/src')) {
$this->markTestSkipped('Monolog dependency was not installed.');
}
......
......@@ -20,15 +20,13 @@ use Symfony\Component\HttpFoundation\Request;
* SecurityTrait test cases.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @requires PHP 5.4
*/
class SecurityTraitTest extends \PHPUnit_Framework_TestCase
{
public function setUp()
{
if (version_compare(phpversion(), '5.4.0', '<')) {
$this->markTestSkipped('PHP 5.4 is required for this test');
}
if (!is_dir(__DIR__.'/../../../../vendor/symfony/security')) {
$this->markTestSkipped('Security dependency was not installed.');
}
......
......@@ -18,15 +18,13 @@ use Silex\Provider\SwiftmailerServiceProvider;
* SwiftmailerTrait test cases.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @requires PHP 5.4
*/
class SwiftmailerTraitTest extends \PHPUnit_Framework_TestCase
{
public function setUp()
{
if (version_compare(phpversion(), '5.4.0', '<')) {
$this->markTestSkipped('PHP 5.4 is required for this test');
}
if (!is_dir(__DIR__.'/../../../../vendor/swiftmailer/swiftmailer')) {
$this->markTestSkipped('Swiftmailer dependency was not installed.');
}
......
......@@ -18,15 +18,13 @@ use Silex\Provider\TranslationServiceProvider;
* TranslationTrait test cases.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @requires PHP 5.4
*/
class TranslationTraitTest extends \PHPUnit_Framework_TestCase
{
public function setUp()
{
if (version_compare(phpversion(), '5.4.0', '<')) {
$this->markTestSkipped('PHP 5.4 is required for this test');
}
if (!is_dir(__DIR__.'/../../../../vendor/symfony/translation')) {
$this->markTestSkipped('Translation dependency was not installed.');
}
......
......@@ -20,15 +20,13 @@ use Symfony\Component\HttpFoundation\StreamedResponse;
* TwigTrait test cases.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @requires PHP 5.4
*/
class TwigTraitTest extends \PHPUnit_Framework_TestCase
{
public function setUp()
{
if (version_compare(phpversion(), '5.4.0', '<')) {
$this->markTestSkipped('PHP 5.4 is required for this test');
}
if (!is_dir(__DIR__.'/../../../../vendor/twig/twig')) {
$this->markTestSkipped('Twig dependency was not installed.');
}
......
......@@ -18,16 +18,11 @@ use Silex\Provider\UrlGeneratorServiceProvider;
* UrlGeneratorTrait test cases.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @requires PHP 5.4
*/
class UrlGeneratorTraitTest extends \PHPUnit_Framework_TestCase
{
public function setUp()
{
if (version_compare(phpversion(), '5.4.0', '<')) {
$this->markTestSkipped('PHP 5.4 is required for this test');
}
}
public function testUrl()
{
$app = $this->createApplication();
......
......@@ -19,15 +19,13 @@ use Symfony\Component\HttpFoundation\Request;
* SecurityTrait test cases.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @requires PHP 5.4
*/
class SecurityTraitTest extends \PHPUnit_Framework_TestCase
{
public function setUp()
{
if (version_compare(phpversion(), '5.4.0', '<')) {
$this->markTestSkipped('PHP 5.4 is required for this test');
}
if (!is_dir(__DIR__.'/../../../../vendor/symfony/security')) {
$this->markTestSkipped('Security dependency was not installed.');
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment