merged branch marekkalnik/form (PR #5717)

This PR was merged into the 2.1 branch.

Commits
-------

5c895c8 [Form][Tests] Make *TestCase files abstract

Discussion
----------

[Form][Tests] Make FormIntegrationTestCase abstract

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: no - but failing tests are unrelated (not in the Form component)
Fixes the following tickets: -
Todo: -
License of the code: MIT
Documentation PR: -

Depending on PHPUnit configuration extending this class in a test makes PHPUnit fail throwing a warning: `No tests found in class "Symfony\Component\Form\Tests\FormIntegrationTestCase"`.

This class should not be run as a test and thus it can be safely converted to abstract. There's also an  incoherence between other TestCases, some of them being abstract and others concrete (eg. compare with *TypeTestCase* inheriting from *FormIntegrationTestCase*). Shouldn't all the TestCases be marked as abstract?

---------------------------------------------------------------------------

by fabpot at 2012-10-10T06:24:53Z

ping @bschussek

---------------------------------------------------------------------------

by bschussek at 2012-10-10T07:52:32Z

No objections. 👍

---------------------------------------------------------------------------

by marekkalnik at 2012-10-10T07:58:46Z

If so - would you accept other pull requests just adding abstract to various *TestCase files? Or I could do it all at once in this PR.

---------------------------------------------------------------------------

by bschussek at 2012-10-10T08:17:17Z

Sure. Tests that shouldn't be run should be abstract.

---------------------------------------------------------------------------

by bschussek at 2012-10-10T08:18:40Z

To answer your question completely: You can add all these changes to this PR. Please do also squash the commits when you're done.

Thanks! :)

---------------------------------------------------------------------------

by marekkalnik at 2012-10-10T11:34:45Z

[![Build Status](https://secure.travis-ci.org/marekkalnik/symfony.png)](http://travis-ci.org/marekkalnik/symfony)

Done.
This commit is contained in:
Fabien Potencier 2012-10-10 16:49:03 +02:00
commit 0247dd5237
4 changed files with 5 additions and 4 deletions

View File

@ -11,10 +11,11 @@
namespace Symfony\Component\Form\Tests\Extension\Core\DataTransformer;
class DateTimeTestCase extends LocalizedTestCase
abstract class DateTimeTestCase extends LocalizedTestCase
{
public static function assertDateTimeEquals(\DateTime $expected, \DateTime $actual)
{
self::assertEquals($expected->format('c'), $actual->format('c'));
}
}

View File

@ -11,7 +11,7 @@
namespace Symfony\Component\Form\Tests\Extension\Core\DataTransformer;
class LocalizedTestCase extends \PHPUnit_Framework_TestCase
abstract class LocalizedTestCase extends \PHPUnit_Framework_TestCase
{
protected static $icuVersion = null;

View File

@ -17,7 +17,7 @@ use Symfony\Component\Form\Extension\Core\CoreExtension;
/**
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class FormIntegrationTestCase extends \PHPUnit_Framework_TestCase
abstract class FormIntegrationTestCase extends \PHPUnit_Framework_TestCase
{
/**
* @var \Symfony\Component\Form\FormFactoryInterface

View File

@ -19,7 +19,7 @@ namespace Symfony\Component\Form\Tests;
* @author robo
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class FormPerformanceTestCase extends FormIntegrationTestCase
abstract class FormPerformanceTestCase extends FormIntegrationTestCase
{
/**
* @var integer