Fixed visibility of PHPUnit setUp and tearDown methods.

This commit is contained in:
Kris Wallsmith 2010-12-06 09:45:37 -05:00 committed by Fabien Potencier
parent 112fb5ad99
commit 3e02eafc70
52 changed files with 57 additions and 57 deletions

View File

@ -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();

View File

@ -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();

View File

@ -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();

View File

@ -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.');

View File

@ -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.');

View File

@ -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);

View File

@ -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.');

View File

@ -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.');

View File

@ -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.');

View File

@ -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);
}

View File

@ -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);

View File

@ -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');

View File

@ -17,7 +17,7 @@ class TokenizerTest extends \PHPUnit_Framework_TestCase
{
protected $tokenizer;
public function setUp()
protected function setUp()
{
$this->tokenizer = new Tokenizer();
}

View File

@ -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);
}

View 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);

View File

@ -8,7 +8,7 @@ class HiddenFieldTest extends \PHPUnit_Framework_TestCase
{
protected $field;
public function setUp()
protected function setUp()
{
$this->field = new HiddenField('name');
}

View File

@ -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');

View File

@ -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'));
}

View File

@ -8,7 +8,7 @@ class BooleanToStringTransformerTest extends \PHPUnit_Framework_TestCase
{
protected $transformer;
public function setUp()
protected function setUp()
{
$this->transformer = new BooleanToStringTransformer();
}

View File

@ -12,7 +12,7 @@ class DateTimeToLocalizedStringTransformerTest extends DateTimeTestCase
protected $dateTime;
protected $dateTimeWithoutSeconds;
public function setUp()
protected function setUp()
{
parent::setUp();

View File

@ -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');
}

View File

@ -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;

View File

@ -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;

View File

@ -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');

View File

@ -9,7 +9,7 @@ class AssertFalseValidatorTest extends \PHPUnit_Framework_TestCase
{
protected $validator;
public function setUp()
protected function setUp()
{
$this->validator = new AssertFalseValidator();
}

View File

@ -9,7 +9,7 @@ class AssertTrueValidatorTest extends \PHPUnit_Framework_TestCase
{
protected $validator;
public function setUp()
protected function setUp()
{
$this->validator = new AssertTrueValidator();
}

View File

@ -11,7 +11,7 @@ class AssertTypeValidatorTest extends \PHPUnit_Framework_TestCase
protected $validator;
public function setUp()
protected function setUp()
{
$this->validator = new AssertTypeValidator();
}

View File

@ -9,7 +9,7 @@ class BlankValidatorTest extends \PHPUnit_Framework_TestCase
{
protected $validator;
public function setUp()
protected function setUp()
{
$this->validator = new BlankValidator();
}

View File

@ -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');

View File

@ -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');

View File

@ -9,7 +9,7 @@ class DateTimeValidatorTest extends \PHPUnit_Framework_TestCase
{
protected $validator;
public function setUp()
protected function setUp()
{
$this->validator = new DateTimeValidator();
}

View File

@ -9,7 +9,7 @@ class DateValidatorTest extends \PHPUnit_Framework_TestCase
{
protected $validator;
public function setUp()
protected function setUp()
{
$this->validator = new DateValidator();
}

View File

@ -9,7 +9,7 @@ class EmailValidatorTest extends \PHPUnit_Framework_TestCase
{
protected $validator;
public function setUp()
protected function setUp()
{
$this->validator = new EmailValidator();
}

View File

@ -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);
}

View File

@ -9,7 +9,7 @@ class MaxLengthValidatorTest extends \PHPUnit_Framework_TestCase
{
protected $validator;
public function setUp()
protected function setUp()
{
$this->validator = new MaxLengthValidator();
}

View File

@ -9,7 +9,7 @@ class MaxValidatorTest extends \PHPUnit_Framework_TestCase
{
protected $validator;
public function setUp()
protected function setUp()
{
$this->validator = new MaxValidator();
}

View File

@ -9,7 +9,7 @@ class MinLengthValidatorTest extends \PHPUnit_Framework_TestCase
{
protected $validator;
public function setUp()
protected function setUp()
{
$this->validator = new MinLengthValidator();
}

View File

@ -9,7 +9,7 @@ class MinValidatorTest extends \PHPUnit_Framework_TestCase
{
protected $validator;
public function setUp()
protected function setUp()
{
$this->validator = new MinValidator();
}

View File

@ -9,7 +9,7 @@ class NotBlankValidatorTest extends \PHPUnit_Framework_TestCase
{
protected $validator;
public function setUp()
protected function setUp()
{
$this->validator = new NotBlankValidator();
}

View File

@ -9,7 +9,7 @@ class NotNullValidatorTest extends \PHPUnit_Framework_TestCase
{
protected $validator;
public function setUp()
protected function setUp()
{
$this->validator = new NotNullValidator();
}

View File

@ -9,7 +9,7 @@ class NullValidatorTest extends \PHPUnit_Framework_TestCase
{
protected $validator;
public function setUp()
protected function setUp()
{
$this->validator = new NullValidator();
}

View File

@ -9,7 +9,7 @@ class RegexValidatorTest extends \PHPUnit_Framework_TestCase
{
protected $validator;
public function setUp()
protected function setUp()
{
$this->validator = new RegexValidator();
}

View File

@ -9,7 +9,7 @@ class TimeValidatorTest extends \PHPUnit_Framework_TestCase
{
protected $validator;
public function setUp()
protected function setUp()
{
$this->validator = new TimeValidator();
}

View File

@ -9,7 +9,7 @@ class UrlValidatorTest extends \PHPUnit_Framework_TestCase
{
protected $validator;
public function setUp()
protected function setUp()
{
$this->validator = new UrlValidator();
}

View File

@ -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());

View File

@ -21,7 +21,7 @@ class ClassMetadataTest extends \PHPUnit_Framework_TestCase
protected $metadata;
public function setUp()
protected function setUp()
{
$this->metadata = new ClassMetadata(self::CLASSNAME);
}

View File

@ -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');
}

View File

@ -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');

View File

@ -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',

View File

@ -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());

View File

@ -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();

View File

@ -24,7 +24,7 @@ class ParserTest extends \PHPUnit_Framework_TestCase
Yaml::setSpecVersion('1.1');
}
public function setUp()
protected function setUp()
{
$this->parser = new Parser();
}