Fixed visibility of PHPUnit setUp and tearDown methods.
This commit is contained in:
parent
112fb5ad99
commit
3e02eafc70
@ -13,7 +13,7 @@ class CollectionToChoiceTransformerTest extends \Symfony\Bundle\DoctrineBundle\T
|
||||
*/
|
||||
private $em;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
$this->em = $this->createTestEntityManager();
|
||||
|
@ -13,7 +13,7 @@ class CollectionToStringTransformerTest extends \Symfony\Bundle\DoctrineBundle\T
|
||||
*/
|
||||
private $em;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
$this->em = $this->createTestEntityManager();
|
||||
|
@ -13,7 +13,7 @@ class EntityToIDTransformerTest extends \Symfony\Bundle\DoctrineBundle\Tests\Tes
|
||||
*/
|
||||
private $em;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
$this->em = $this->createTestEntityManager();
|
||||
|
@ -15,7 +15,7 @@ use Doctrine\ORM\EntityManager;
|
||||
|
||||
class TestCase extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
if (!class_exists('Doctrine\\Common\\Version')) {
|
||||
$this->markTestSkipped('Doctrine is not available.');
|
||||
|
@ -13,7 +13,7 @@ namespace Symfony\Bundle\DoctrineMongoDBBundle\Tests;
|
||||
|
||||
class TestCase extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
if (!class_exists('Doctrine\\ODM\\MongoDB\\Version')) {
|
||||
$this->markTestSkipped('Doctrine MongoDB ODM is not available.');
|
||||
|
@ -19,7 +19,7 @@ class MustacheTest extends TestCase
|
||||
{
|
||||
protected $dir;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$dir = __DIR__.'/fixtures/';
|
||||
|
||||
@ -28,7 +28,7 @@ class MustacheTest extends TestCase
|
||||
$filesystem->mirror($dir, $this->dir);
|
||||
}
|
||||
|
||||
public function tearDown()
|
||||
protected function tearDown()
|
||||
{
|
||||
$filesystem = new Filesystem();
|
||||
$filesystem->remove($this->dir);
|
||||
|
@ -13,7 +13,7 @@ namespace Symfony\Bundle\SwiftmailerBundle\Tests;
|
||||
|
||||
class TestCase extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
if (!class_exists('Swift_Mailer')) {
|
||||
$this->markTestSkipped('Swiftmailer is not available.');
|
||||
|
@ -13,7 +13,7 @@ namespace Symfony\Bundle\TwigBundle\Tests;
|
||||
|
||||
class TestCase extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
if (!class_exists('Twig_Environment')) {
|
||||
$this->markTestSkipped('Twig is not available.');
|
||||
|
@ -13,7 +13,7 @@ namespace Symfony\Bundle\ZendBundle\Tests;
|
||||
|
||||
class TestCase extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
if (!class_exists('Zend\\Log\\Logger')) {
|
||||
$this->markTestSkipped('Zend Framework is not available.');
|
||||
|
@ -17,7 +17,7 @@ class StreamOutputTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected $stream;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->stream = fopen('php://memory', 'a', false);
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ class ApplicationTesterTest extends \PHPUnit_Framework_TestCase
|
||||
protected $application;
|
||||
protected $tester;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->application = new Application();
|
||||
$this->application->setAutoExit(false);
|
||||
|
@ -19,7 +19,7 @@ class CommandTesterTest extends \PHPUnit_Framework_TestCase
|
||||
protected $application;
|
||||
protected $tester;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->command = new Command('foo');
|
||||
$this->command->addArgument('command');
|
||||
|
@ -17,7 +17,7 @@ class TokenizerTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected $tokenizer;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->tokenizer = new Tokenizer();
|
||||
}
|
||||
|
@ -17,14 +17,14 @@ class FileResourceTest extends \PHPUnit_Framework_TestCase
|
||||
protected $resource;
|
||||
protected $file;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->file = sys_get_temp_dir().'/tmp.xml';
|
||||
touch($this->file);
|
||||
$this->resource = new FileResource($this->file);
|
||||
}
|
||||
|
||||
public function tearDown()
|
||||
protected function tearDown()
|
||||
{
|
||||
unlink($this->file);
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ class FileFieldTest extends \PHPUnit_Framework_TestCase
|
||||
@session_start();
|
||||
}
|
||||
|
||||
public function tearDown()
|
||||
protected function tearDown()
|
||||
{
|
||||
foreach (self::$tmpFiles as $key => $file) {
|
||||
@unlink($file);
|
||||
|
@ -8,7 +8,7 @@ class HiddenFieldTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected $field;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->field = new HiddenField('name');
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ namespace Symfony\Tests\Component\Form;
|
||||
|
||||
class LocalizedTestCase extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
if (!extension_loaded('intl')) {
|
||||
$this->markTestSkipped('The "intl" extension is not available');
|
||||
|
@ -11,7 +11,7 @@ class RepeatedFieldTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected $field;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->field = new RepeatedField(new TestField('name'));
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ class BooleanToStringTransformerTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected $transformer;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->transformer = new BooleanToStringTransformer();
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ class DateTimeToLocalizedStringTransformerTest extends DateTimeTestCase
|
||||
protected $dateTime;
|
||||
protected $dateTimeWithoutSeconds;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -10,7 +10,7 @@ class FileTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected $file;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->file = new File(__DIR__.'/Fixtures/test.gif');
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ class CacheTestCase extends \PHPUnit_Framework_TestCase
|
||||
protected $response;
|
||||
protected $responses;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->kernel = null;
|
||||
|
||||
@ -42,7 +42,7 @@ class CacheTestCase extends \PHPUnit_Framework_TestCase
|
||||
$this->clearDirectory(sys_get_temp_dir().'/http_cache');
|
||||
}
|
||||
|
||||
public function tearDown()
|
||||
protected function tearDown()
|
||||
{
|
||||
$this->kernel = null;
|
||||
$this->cache = null;
|
||||
|
@ -23,7 +23,7 @@ class CacheStoreTest extends \PHPUnit_Framework_TestCase
|
||||
protected $response;
|
||||
protected $store;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->request = Request::create('/');
|
||||
$this->response = new Response('hello world', 200, array());
|
||||
@ -33,7 +33,7 @@ class CacheStoreTest extends \PHPUnit_Framework_TestCase
|
||||
$this->store = new Store(sys_get_temp_dir().'/http_cache');
|
||||
}
|
||||
|
||||
public function tearDown()
|
||||
protected function tearDown()
|
||||
{
|
||||
$this->store = null;
|
||||
|
||||
|
@ -13,7 +13,7 @@ class AllValidatorTest extends \PHPUnit_Framework_TestCase
|
||||
protected $walker;
|
||||
protected $context;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->walker = $this->getMock('Symfony\Component\Validator\GraphWalker', array(), array(), '', false);
|
||||
$metadataFactory = $this->getMock('Symfony\Component\Validator\Mapping\ClassMetadataFactoryInterface');
|
||||
|
@ -9,7 +9,7 @@ class AssertFalseValidatorTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected $validator;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->validator = new AssertFalseValidator();
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ class AssertTrueValidatorTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected $validator;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->validator = new AssertTrueValidator();
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ class AssertTypeValidatorTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
protected $validator;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->validator = new AssertTypeValidator();
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ class BlankValidatorTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected $validator;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->validator = new BlankValidator();
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ class ChoiceValidatorTest extends \PHPUnit_Framework_TestCase
|
||||
return array('foo', 'bar');
|
||||
}
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$walker = $this->getMock('Symfony\Component\Validator\GraphWalker', array(), array(), '', false);
|
||||
$factory = $this->getMock('Symfony\Component\Validator\Mapping\ClassMetadataFactoryInterface');
|
||||
|
@ -13,7 +13,7 @@ class CollectionValidatorTest extends \PHPUnit_Framework_TestCase
|
||||
protected $walker;
|
||||
protected $context;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->walker = $this->getMock('Symfony\Component\Validator\GraphWalker', array(), array(), '', false);
|
||||
$metadataFactory = $this->getMock('Symfony\Component\Validator\Mapping\ClassMetadataFactoryInterface');
|
||||
|
@ -9,7 +9,7 @@ class DateTimeValidatorTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected $validator;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->validator = new DateTimeValidator();
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ class DateValidatorTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected $validator;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->validator = new DateValidator();
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ class EmailValidatorTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected $validator;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->validator = new EmailValidator();
|
||||
}
|
||||
|
@ -11,14 +11,14 @@ class FileValidatorTest extends \PHPUnit_Framework_TestCase
|
||||
protected $path;
|
||||
protected $file;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->validator = new FileValidator();
|
||||
$this->path = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'FileValidatorTest';
|
||||
$this->file = fopen($this->path, 'w');
|
||||
}
|
||||
|
||||
public function tearDown()
|
||||
protected function tearDown()
|
||||
{
|
||||
fclose($this->file);
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ class MaxLengthValidatorTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected $validator;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->validator = new MaxLengthValidator();
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ class MaxValidatorTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected $validator;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->validator = new MaxValidator();
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ class MinLengthValidatorTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected $validator;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->validator = new MinLengthValidator();
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ class MinValidatorTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected $validator;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->validator = new MinValidator();
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ class NotBlankValidatorTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected $validator;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->validator = new NotBlankValidator();
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ class NotNullValidatorTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected $validator;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->validator = new NotNullValidator();
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ class NullValidatorTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected $validator;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->validator = new NullValidator();
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ class RegexValidatorTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected $validator;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->validator = new RegexValidator();
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ class TimeValidatorTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected $validator;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->validator = new TimeValidator();
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ class UrlValidatorTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected $validator;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->validator = new UrlValidator();
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ class GraphWalkerTest extends \PHPUnit_Framework_TestCase
|
||||
protected $walker;
|
||||
protected $metadata;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->factory = new FakeClassMetadataFactory();
|
||||
$this->walker = new GraphWalker('Root', $this->factory, new ConstraintValidatorFactory());
|
||||
|
@ -21,7 +21,7 @@ class ClassMetadataTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
protected $metadata;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->metadata = new ClassMetadata(self::CLASSNAME);
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ class ElementMetadataTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected $metadata;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->metadata = new TestElementMetadata('Symfony\Tests\Component\Validator\Fixtures\Entity');
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ use Symfony\Tests\Component\Validator\Fixtures\ConstraintA;
|
||||
|
||||
class AnnotationLoaderTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
if (!class_exists('Doctrine\Common\Annotations\AnnotationReader')) {
|
||||
$this->markTestSkipped('Unmet dependency: doctrine-common is required for this test');
|
||||
|
@ -14,7 +14,7 @@ class MemberMetadataTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected $metadata;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->metadata = new TestMemberMetadata(
|
||||
'Symfony\Tests\Component\Validator\Fixtures\Entity',
|
||||
|
@ -21,7 +21,7 @@ class ValidatorTest extends \PHPUnit_Framework_TestCase
|
||||
protected $factory;
|
||||
protected $validator;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->factory = new FakeClassMetadataFactory();
|
||||
$this->validator = new Validator($this->factory, new ConstraintValidatorFactory());
|
||||
|
@ -25,7 +25,7 @@ class DumperTest extends \PHPUnit_Framework_TestCase
|
||||
Yaml::setSpecVersion('1.1');
|
||||
}
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->parser = new Parser();
|
||||
$this->dumper = new Dumper();
|
||||
|
@ -24,7 +24,7 @@ class ParserTest extends \PHPUnit_Framework_TestCase
|
||||
Yaml::setSpecVersion('1.1');
|
||||
}
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->parser = new Parser();
|
||||
}
|
||||
|
Reference in New Issue
Block a user