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; ...@@ -18,15 +18,13 @@ use Silex\Provider\FormServiceProvider;
* FormTrait test cases. * FormTrait test cases.
* *
* @author Fabien Potencier <fabien@symfony.com> * @author Fabien Potencier <fabien@symfony.com>
*
* @requires PHP 5.4
*/ */
class FormTraitTest extends \PHPUnit_Framework_TestCase class FormTraitTest extends \PHPUnit_Framework_TestCase
{ {
public function setUp() 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')) { if (!is_dir(__DIR__.'/../../../../vendor/symfony/form')) {
$this->markTestSkipped('Form dependency was not installed.'); $this->markTestSkipped('Form dependency was not installed.');
} }
......
...@@ -20,15 +20,13 @@ use Monolog\Logger; ...@@ -20,15 +20,13 @@ use Monolog\Logger;
* MonologTrait test cases. * MonologTrait test cases.
* *
* @author Fabien Potencier <fabien@symfony.com> * @author Fabien Potencier <fabien@symfony.com>
*
* @requires PHP 5.4
*/ */
class MonologTraitTest extends \PHPUnit_Framework_TestCase class MonologTraitTest extends \PHPUnit_Framework_TestCase
{ {
public function setUp() 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')) { if (!is_dir(__DIR__.'/../../../../vendor/monolog/monolog/src')) {
$this->markTestSkipped('Monolog dependency was not installed.'); $this->markTestSkipped('Monolog dependency was not installed.');
} }
......
...@@ -20,15 +20,13 @@ use Symfony\Component\HttpFoundation\Request; ...@@ -20,15 +20,13 @@ use Symfony\Component\HttpFoundation\Request;
* SecurityTrait test cases. * SecurityTrait test cases.
* *
* @author Fabien Potencier <fabien@symfony.com> * @author Fabien Potencier <fabien@symfony.com>
*
* @requires PHP 5.4
*/ */
class SecurityTraitTest extends \PHPUnit_Framework_TestCase class SecurityTraitTest extends \PHPUnit_Framework_TestCase
{ {
public function setUp() 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')) { if (!is_dir(__DIR__.'/../../../../vendor/symfony/security')) {
$this->markTestSkipped('Security dependency was not installed.'); $this->markTestSkipped('Security dependency was not installed.');
} }
......
...@@ -18,15 +18,13 @@ use Silex\Provider\SwiftmailerServiceProvider; ...@@ -18,15 +18,13 @@ use Silex\Provider\SwiftmailerServiceProvider;
* SwiftmailerTrait test cases. * SwiftmailerTrait test cases.
* *
* @author Fabien Potencier <fabien@symfony.com> * @author Fabien Potencier <fabien@symfony.com>
*
* @requires PHP 5.4
*/ */
class SwiftmailerTraitTest extends \PHPUnit_Framework_TestCase class SwiftmailerTraitTest extends \PHPUnit_Framework_TestCase
{ {
public function setUp() 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')) { if (!is_dir(__DIR__.'/../../../../vendor/swiftmailer/swiftmailer')) {
$this->markTestSkipped('Swiftmailer dependency was not installed.'); $this->markTestSkipped('Swiftmailer dependency was not installed.');
} }
......
...@@ -18,15 +18,13 @@ use Silex\Provider\TranslationServiceProvider; ...@@ -18,15 +18,13 @@ use Silex\Provider\TranslationServiceProvider;
* TranslationTrait test cases. * TranslationTrait test cases.
* *
* @author Fabien Potencier <fabien@symfony.com> * @author Fabien Potencier <fabien@symfony.com>
*
* @requires PHP 5.4
*/ */
class TranslationTraitTest extends \PHPUnit_Framework_TestCase class TranslationTraitTest extends \PHPUnit_Framework_TestCase
{ {
public function setUp() 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')) { if (!is_dir(__DIR__.'/../../../../vendor/symfony/translation')) {
$this->markTestSkipped('Translation dependency was not installed.'); $this->markTestSkipped('Translation dependency was not installed.');
} }
......
...@@ -20,15 +20,13 @@ use Symfony\Component\HttpFoundation\StreamedResponse; ...@@ -20,15 +20,13 @@ use Symfony\Component\HttpFoundation\StreamedResponse;
* TwigTrait test cases. * TwigTrait test cases.
* *
* @author Fabien Potencier <fabien@symfony.com> * @author Fabien Potencier <fabien@symfony.com>
*
* @requires PHP 5.4
*/ */
class TwigTraitTest extends \PHPUnit_Framework_TestCase class TwigTraitTest extends \PHPUnit_Framework_TestCase
{ {
public function setUp() 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')) { if (!is_dir(__DIR__.'/../../../../vendor/twig/twig')) {
$this->markTestSkipped('Twig dependency was not installed.'); $this->markTestSkipped('Twig dependency was not installed.');
} }
......
...@@ -18,16 +18,11 @@ use Silex\Provider\UrlGeneratorServiceProvider; ...@@ -18,16 +18,11 @@ use Silex\Provider\UrlGeneratorServiceProvider;
* UrlGeneratorTrait test cases. * UrlGeneratorTrait test cases.
* *
* @author Fabien Potencier <fabien@symfony.com> * @author Fabien Potencier <fabien@symfony.com>
*
* @requires PHP 5.4
*/ */
class UrlGeneratorTraitTest extends \PHPUnit_Framework_TestCase 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() public function testUrl()
{ {
$app = $this->createApplication(); $app = $this->createApplication();
......
...@@ -19,15 +19,13 @@ use Symfony\Component\HttpFoundation\Request; ...@@ -19,15 +19,13 @@ use Symfony\Component\HttpFoundation\Request;
* SecurityTrait test cases. * SecurityTrait test cases.
* *
* @author Fabien Potencier <fabien@symfony.com> * @author Fabien Potencier <fabien@symfony.com>
*
* @requires PHP 5.4
*/ */
class SecurityTraitTest extends \PHPUnit_Framework_TestCase class SecurityTraitTest extends \PHPUnit_Framework_TestCase
{ {
public function setUp() 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')) { if (!is_dir(__DIR__.'/../../../../vendor/symfony/security')) {
$this->markTestSkipped('Security dependency was not installed.'); $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