[2.3] Remove useless tests skips

This commit is contained in:
Nicolas Grekas 2015-01-03 10:53:32 +01:00
parent 1d68ad3265
commit d649befa67
151 changed files with 16 additions and 1303 deletions

View File

@ -18,10 +18,6 @@ class ContainerAwareEventManagerTest extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
if (!class_exists('Symfony\Component\DependencyInjection\Container')) {
$this->markTestSkipped('The "DependencyInjection" component is not available');
}
$this->container = new Container();
$this->evm = new ContainerAwareEventManager($this->container);
}

View File

@ -18,17 +18,6 @@ use Symfony\Component\HttpFoundation\Response;
class DoctrineDataCollectorTest extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
if (!class_exists('Doctrine\DBAL\Platforms\MySqlPlatform')) {
$this->markTestSkipped('Doctrine DBAL is not available.');
}
if (!class_exists('Symfony\Component\HttpKernel\HttpKernel')) {
$this->markTestSkipped('The "HttpKernel" component is not available');
}
}
public function testCollectConnections()
{
$c = $this->createCollector(array());

View File

@ -16,17 +16,6 @@ use Symfony\Bridge\Doctrine\Tests\Fixtures\ContainerAwareFixture;
class ContainerAwareLoaderTest extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
if (!class_exists('Symfony\Component\DependencyInjection\Container')) {
$this->markTestSkipped('The "DependencyInjection" component is not available');
}
if (!class_exists('Doctrine\Common\DataFixtures\Loader')) {
$this->markTestSkipped('Doctrine Data Fixtures is not available.');
}
}
public function testShouldSetContainerOnContainerAwareFixture()
{
$container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');

View File

@ -17,13 +17,6 @@ use Symfony\Component\DependencyInjection\Definition;
class RegisterEventListenersAndSubscribersPassTest extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
if (!class_exists('Symfony\Component\DependencyInjection\Container')) {
$this->markTestSkipped('The "DependencyInjection" component is not available');
}
}
/**
* @expectedException \InvalidArgumentException
*/

View File

@ -21,21 +21,6 @@ use Symfony\Bridge\Doctrine\Test\DoctrineTestHelper;
*/
abstract class DoctrineOrmTestCase extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
if (!class_exists('Doctrine\Common\Version')) {
$this->markTestSkipped('Doctrine Common is not available.');
}
if (!class_exists('Doctrine\DBAL\Platforms\MySqlPlatform')) {
$this->markTestSkipped('Doctrine DBAL is not available.');
}
if (!class_exists('Doctrine\ORM\EntityManager')) {
$this->markTestSkipped('Doctrine ORM is not available.');
}
}
/**
* @return \Doctrine\ORM\EntityManager
*/

View File

@ -36,22 +36,6 @@ abstract class AbstractEntityChoiceListTest extends AbstractChoiceListTest
protected function setUp()
{
if (!class_exists('Symfony\Component\Form\Form')) {
$this->markTestSkipped('The "Form" component is not available');
}
if (!class_exists('Doctrine\DBAL\Platforms\MySqlPlatform')) {
$this->markTestSkipped('Doctrine DBAL is not available.');
}
if (!class_exists('Doctrine\Common\Version')) {
$this->markTestSkipped('Doctrine Common is not available.');
}
if (!class_exists('Doctrine\ORM\EntityManager')) {
$this->markTestSkipped('Doctrine ORM is not available.');
}
$this->em = DoctrineTestHelper::createTestEntityManager();
$schemaTool = new SchemaTool($this->em);

View File

@ -36,22 +36,6 @@ class GenericEntityChoiceListTest extends \PHPUnit_Framework_TestCase
protected function setUp()
{
if (!class_exists('Symfony\Component\Form\Form')) {
$this->markTestSkipped('The "Form" component is not available');
}
if (!class_exists('Doctrine\DBAL\Platforms\MySqlPlatform')) {
$this->markTestSkipped('Doctrine DBAL is not available.');
}
if (!class_exists('Doctrine\Common\Version')) {
$this->markTestSkipped('Doctrine Common is not available.');
}
if (!class_exists('Doctrine\ORM\EntityManager')) {
$this->markTestSkipped('Doctrine ORM is not available.');
}
$this->em = DoctrineTestHelper::createTestEntityManager();
$schemaTool = new SchemaTool($this->em);

View File

@ -50,22 +50,6 @@ class EntityTypePerformanceTest extends FormPerformanceTestCase
protected function setUp()
{
if (!class_exists('Symfony\Component\Form\Form')) {
$this->markTestSkipped('The "Form" component is not available');
}
if (!class_exists('Doctrine\DBAL\Platforms\MySqlPlatform')) {
$this->markTestSkipped('Doctrine DBAL is not available.');
}
if (!class_exists('Doctrine\Common\Version')) {
$this->markTestSkipped('Doctrine Common is not available.');
}
if (!class_exists('Doctrine\ORM\EntityManager')) {
$this->markTestSkipped('Doctrine ORM is not available.');
}
$this->em = DoctrineTestHelper::createTestEntityManager();
parent::setUp();

View File

@ -43,22 +43,6 @@ class EntityTypeTest extends TypeTestCase
protected function setUp()
{
if (!class_exists('Symfony\Component\Form\Form')) {
$this->markTestSkipped('The "Form" component is not available');
}
if (!class_exists('Doctrine\DBAL\Platforms\MySqlPlatform')) {
$this->markTestSkipped('Doctrine DBAL is not available.');
}
if (!class_exists('Doctrine\Common\Version')) {
$this->markTestSkipped('Doctrine Common is not available.');
}
if (!class_exists('Doctrine\ORM\EntityManager')) {
$this->markTestSkipped('Doctrine ORM is not available.');
}
$this->em = DoctrineTestHelper::createTestEntityManager();
$this->emRegistry = $this->createRegistryMock('default', $this->em);

View File

@ -20,13 +20,6 @@ use Symfony\Bridge\Doctrine\HttpFoundation\DbalSessionHandler;
*/
class DbalSessionHandlerTest extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
$this->markTestSkipped('The "HttpFoundation" component is not available');
}
}
public function testConstruct()
{
$connection = $this->getMockBuilder('Doctrine\DBAL\Connection')->disableOriginalConstructor()->getMock();

View File

@ -18,15 +18,6 @@ use Doctrine\ORM\Tools\SchemaTool;
class EntityUserProviderTest extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
if (!class_exists('Symfony\Component\Security\Core\SecurityContext')) {
$this->markTestSkipped('The "Security" component is not available');
}
parent::setUp();
}
public function testRefreshUserGetsUserByPrimaryKey()
{
$em = DoctrineTestHelper::createTestEntityManager();

View File

@ -18,13 +18,6 @@ use Symfony\Component\HttpKernel\HttpKernelInterface;
class WebProcessorTest extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
if (!class_exists('Monolog\\Logger')) {
$this->markTestSkipped('Monolog is not available.');
}
}
public function testUsesRequestServerData()
{
$server = array(

View File

@ -18,13 +18,6 @@ use Symfony\Bridge\Propel1\Tests\Propel1TestCase;
class PropelDataCollectorTest extends Propel1TestCase
{
protected function setUp()
{
if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
$this->markTestSkipped('The "HttpFoundation" component is not available');
}
}
public function testCollectWithoutData()
{
$c = $this->createCollector(array());

View File

@ -21,23 +21,6 @@ class CompatModelChoiceListTest extends AbstractChoiceListTest
protected $item3;
protected $item4;
public static function setUpBeforeClass()
{
if (!class_exists('\Propel')) {
self::markTestSkipped('Propel is not available.');
}
if (!class_exists('Symfony\Component\Form\Form')) {
self::markTestSkipped('The "Form" component is not available');
}
if (!class_exists('Symfony\Component\PropertyAccess\PropertyAccessor')) {
self::markTestSkipped('The "PropertyAccessor" component is not available');
}
parent::setUpBeforeClass();
}
public function testGetChoicesForValues()
{
$this->query

View File

@ -22,19 +22,6 @@ class ModelChoiceListTest extends Propel1TestCase
{
const ITEM_CLASS = '\Symfony\Bridge\Propel1\Tests\Fixtures\Item';
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
if (!class_exists('Symfony\Component\Form\Form')) {
self::markTestSkipped('The "Form" component is not available');
}
if (!class_exists('Symfony\Component\PropertyAccess\PropertyAccessor')) {
self::markTestSkipped('The "PropertyAccessor" component is not available');
}
}
protected function setUp()
{
ItemQuery::$result = array();

View File

@ -20,12 +20,6 @@ class CollectionToArrayTransformerTest extends Propel1TestCase
protected function setUp()
{
if (!class_exists('Symfony\Component\Form\Form')) {
$this->markTestSkipped('The "Form" component is not available');
}
parent::setUp();
$this->transformer = new CollectionToArrayTransformer();
}

View File

@ -13,10 +13,4 @@ namespace Symfony\Bridge\Propel1\Tests;
abstract class Propel1TestCase extends \PHPUnit_Framework_TestCase
{
public static function setUpBeforeClass()
{
if (!class_exists('\Propel')) {
self::markTestSkipped('Propel is not available.');
}
}
}

View File

@ -18,19 +18,6 @@ use Symfony\Component\HttpKernel\Fragment\FragmentHandler;
class HttpKernelExtensionTest extends TestCase
{
protected function setUp()
{
parent::setUp();
if (!class_exists('Symfony\Component\HttpKernel\HttpKernel')) {
$this->markTestSkipped('The "HttpKernel" component is not available');
}
if (!class_exists('Twig_Environment')) {
$this->markTestSkipped('Twig is not available.');
}
}
/**
* @expectedException \Twig_Error_Runtime
*/

View File

@ -16,15 +16,6 @@ use Symfony\Bridge\Twig\Tests\TestCase;
class RoutingExtensionTest extends TestCase
{
protected function setUp()
{
parent::setUp();
if (!class_exists('Symfony\Component\Routing\Route')) {
$this->markTestSkipped('The "Routing" component is not available');
}
}
/**
* @dataProvider getEscapingTemplates
*/

View File

@ -19,19 +19,6 @@ use Symfony\Bridge\Twig\Tests\TestCase;
class TranslationExtensionTest extends TestCase
{
protected function setUp()
{
parent::setUp();
if (!class_exists('Symfony\Component\Translation\Translator')) {
$this->markTestSkipped('The "Translation" component is not available');
}
if (!class_exists('Twig_Environment')) {
$this->markTestSkipped('Twig is not available.');
}
}
public function testEscaping()
{
$output = $this->getTemplate('{% trans %}Percent: %value%%% (%msg%){% endtrans %}')->render(array('value' => 12, 'msg' => 'approx.'));

View File

@ -13,10 +13,4 @@ namespace Symfony\Bridge\Twig\Tests;
abstract class TestCase extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
if (!class_exists('Twig_Environment')) {
$this->markTestSkipped('Twig is not available.');
}
}
}

View File

@ -18,13 +18,6 @@ use Symfony\Bridge\Twig\Tests\TestCase;
class TwigExtractorTest extends TestCase
{
protected function setUp()
{
if (!class_exists('Symfony\Component\Translation\Translator')) {
$this->markTestSkipped('The "Translation" component is not available');
}
}
/**
* @dataProvider getExtractData
*/

View File

@ -235,10 +235,6 @@ abstract class FrameworkExtensionTest extends TestCase
public function testAnnotations()
{
if (!class_exists('Doctrine\\Common\\Version')) {
$this->markTestSkipped('Doctrine is not available.');
}
$container = $this->createContainerFromFile('full');
$this->assertEquals($container->getParameter('kernel.cache_dir').'/annotations', $container->getDefinition('annotations.file_cache_reader')->getArgument(1));

View File

@ -23,15 +23,6 @@ class WebTestCase extends BaseWebTestCase
self::assertEquals('http://localhost'.$location, $response->headers->get('Location'));
}
protected function setUp()
{
if (!class_exists('Twig_Environment')) {
$this->markTestSkipped('Twig is not available.');
}
parent::setUp();
}
protected function deleteTmpDir($testCase)
{
if (!file_exists($dir = sys_get_temp_dir().'/'.Kernel::VERSION.'/'.$testCase)) {

View File

@ -27,19 +27,6 @@ class FormHelperDivLayoutTest extends AbstractDivLayoutTest
*/
protected $engine;
protected function setUp()
{
if (!class_exists('Symfony\Bundle\FrameworkBundle\Templating\Helper\TranslatorHelper')) {
$this->markTestSkipped('The "FrameworkBundle" is not available');
}
if (!class_exists('Symfony\Component\Templating\PhpEngine')) {
$this->markTestSkipped('The "Templating" component is not available');
}
parent::setUp();
}
protected function getExtensions()
{
// should be moved to the Form component once absolute file paths are supported

View File

@ -27,19 +27,6 @@ class FormHelperTableLayoutTest extends AbstractTableLayoutTest
*/
protected $engine;
protected function setUp()
{
if (!class_exists('Symfony\Bundle\FrameworkBundle\Templating\Helper\TranslatorHelper')) {
$this->markTestSkipped('The "FrameworkBundle" is not available');
}
if (!class_exists('Symfony\Component\Templating\PhpEngine')) {
$this->markTestSkipped('The "Templating" component is not available');
}
parent::setUp();
}
protected function getExtensions()
{
// should be moved to the Form component once absolute file paths are supported

View File

@ -23,15 +23,6 @@ class WebTestCase extends BaseWebTestCase
self::assertEquals('http://localhost'.$location, $response->headers->get('Location'));
}
protected function setUp()
{
if (!class_exists('Twig_Environment')) {
$this->markTestSkipped('Twig is not available.');
}
parent::setUp();
}
protected function deleteTmpDir($testCase)
{
if (!file_exists($dir = sys_get_temp_dir().'/'.Kernel::VERSION.'/'.$testCase)) {

View File

@ -13,10 +13,4 @@ namespace Symfony\Bundle\TwigBundle\Tests;
class TestCase extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
if (!class_exists('Twig_Environment')) {
$this->markTestSkipped('Twig is not available.');
}
}
}

View File

@ -13,10 +13,4 @@ namespace Symfony\Bundle\WebProfilerBundle\Tests;
class TestCase extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
if (!class_exists('Twig_Environment')) {
$this->markTestSkipped('Twig is not available.');
}
}
}

View File

@ -268,14 +268,6 @@ class ClientTest extends \PHPUnit_Framework_TestCase
public function testClick()
{
if (!class_exists('Symfony\Component\DomCrawler\Crawler')) {
$this->markTestSkipped('The "DomCrawler" component is not available');
}
if (!class_exists('Symfony\Component\CssSelector\CssSelector')) {
$this->markTestSkipped('The "CssSelector" component is not available');
}
$client = new TestClient();
$client->setNextResponse(new Response('<html><a href="/foo">foo</a></html>'));
$crawler = $client->request('GET', 'http://www.example.com/foo/foobar');
@ -287,14 +279,6 @@ class ClientTest extends \PHPUnit_Framework_TestCase
public function testClickForm()
{
if (!class_exists('Symfony\Component\DomCrawler\Crawler')) {
$this->markTestSkipped('The "DomCrawler" component is not available');
}
if (!class_exists('Symfony\Component\CssSelector\CssSelector')) {
$this->markTestSkipped('The "CssSelector" component is not available');
}
$client = new TestClient();
$client->setNextResponse(new Response('<html><form action="/foo"><input type="submit" /></form></html>'));
$crawler = $client->request('GET', 'http://www.example.com/foo/foobar');
@ -306,14 +290,6 @@ class ClientTest extends \PHPUnit_Framework_TestCase
public function testSubmit()
{
if (!class_exists('Symfony\Component\DomCrawler\Crawler')) {
$this->markTestSkipped('The "DomCrawler" component is not available');
}
if (!class_exists('Symfony\Component\CssSelector\CssSelector')) {
$this->markTestSkipped('The "CssSelector" component is not available');
}
$client = new TestClient();
$client->setNextResponse(new Response('<html><form action="/foo"><input type="submit" /></form></html>'));
$crawler = $client->request('GET', 'http://www.example.com/foo/foobar');
@ -325,14 +301,6 @@ class ClientTest extends \PHPUnit_Framework_TestCase
public function testSubmitPreserveAuth()
{
if (!class_exists('Symfony\Component\DomCrawler\Crawler')) {
$this->markTestSkipped('The "DomCrawler" component is not available');
}
if (!class_exists('Symfony\Component\CssSelector\CssSelector')) {
$this->markTestSkipped('The "CssSelector" component is not available');
}
$client = new TestClient(array('PHP_AUTH_USER' => 'foo', 'PHP_AUTH_PW' => 'bar'));
$client->setNextResponse(new Response('<html><form action="/foo"><input type="submit" /></form></html>'));
$crawler = $client->request('GET', 'http://www.example.com/foo/foobar');
@ -581,10 +549,6 @@ class ClientTest extends \PHPUnit_Framework_TestCase
public function testInsulatedRequests()
{
if (!class_exists('Symfony\Component\Process\Process')) {
$this->markTestSkipped('The "Process" component is not available');
}
$client = new TestClient();
$client->insulate();
$client->setNextScript("new Symfony\Component\BrowserKit\Response('foobar')");

View File

@ -120,10 +120,6 @@ class ClassMapGeneratorTest extends \PHPUnit_Framework_TestCase
public function testCreateMapFinderSupport()
{
if (!class_exists('Symfony\\Component\\Finder\\Finder')) {
$this->markTestSkipped('Finder component is not available');
}
$finder = new \Symfony\Component\Finder\Finder();
$finder->files()->in(__DIR__.'/Fixtures/beta/NamespaceCollision');

View File

@ -769,10 +769,6 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
public function testRunWithDispatcher()
{
if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) {
$this->markTestSkipped('The "EventDispatcher" component is not available');
}
$application = new Application();
$application->setAutoExit(false);
$application->setDispatcher($this->getDispatcher());
@ -792,10 +788,6 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
*/
public function testRunWithExceptionAndDispatcher()
{
if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) {
$this->markTestSkipped('The "EventDispatcher" component is not available');
}
$application = new Application();
$application->setDispatcher($this->getDispatcher());
$application->setAutoExit(false);
@ -811,10 +803,6 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
public function testRunDispatchesAllEventsWithException()
{
if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) {
$this->markTestSkipped('The "EventDispatcher" component is not available');
}
$application = new Application();
$application->setDispatcher($this->getDispatcher());
$application->setAutoExit(false);

View File

@ -17,13 +17,6 @@ use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException;
class ExceptionHandlerTest extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
$this->markTestSkipped('The "HttpFoundation" component is not available');
}
}
public function testDebug()
{
$handler = new ExceptionHandler(false);

View File

@ -498,10 +498,6 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
*/
public function testAddObjectResource()
{
if (!class_exists('Symfony\Component\Config\Resource\FileResource')) {
$this->markTestSkipped('The "Config" component is not available');
}
$container = new ContainerBuilder();
$container->setResourceTracking(false);
@ -528,10 +524,6 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
*/
public function testAddClassResource()
{
if (!class_exists('Symfony\Component\Config\Resource\FileResource')) {
$this->markTestSkipped('The "Config" component is not available');
}
$container = new ContainerBuilder();
$container->setResourceTracking(false);
@ -558,10 +550,6 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
*/
public function testCompilesClassDefinitionsOfLazyServices()
{
if (!class_exists('Symfony\Component\Config\Resource\FileResource')) {
$this->markTestSkipped('The "Config" component is not available');
}
$container = new ContainerBuilder();
$this->assertEmpty($container->getResources(), 'No resources get registered without resource tracking');
@ -588,10 +576,6 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
*/
public function testResources()
{
if (!class_exists('Symfony\Component\Config\Resource\FileResource')) {
$this->markTestSkipped('The "Config" component is not available');
}
$container = new ContainerBuilder();
$container->addResource($a = new FileResource(__DIR__.'/Fixtures/xml/services1.xml'));
$container->addResource($b = new FileResource(__DIR__.'/Fixtures/xml/services2.xml'));
@ -682,10 +666,6 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
*/
public function testThrowsExceptionWhenAddServiceOnAFrozenContainer()
{
if (!class_exists('Symfony\Component\Config\Resource\FileResource')) {
$this->markTestSkipped('The "Config" component is not available');
}
$container = new ContainerBuilder();
$container->compile();
$container->set('a', new \stdClass());
@ -693,10 +673,6 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
public function testNoExceptionWhenSetSyntheticServiceOnAFrozenContainer()
{
if (!class_exists('Symfony\Component\Config\Resource\FileResource')) {
$this->markTestSkipped('The "Config" component is not available');
}
$container = new ContainerBuilder();
$def = new Definition('stdClass');
$def->setSynthetic(true);

View File

@ -18,13 +18,6 @@ class CrossCheckTest extends \PHPUnit_Framework_TestCase
{
protected static $fixturesPath;
protected function setUp()
{
if (!class_exists('Symfony\Component\Config\Loader\Loader')) {
$this->markTestSkipped('The "Config" component is not available');
}
}
public static function setUpBeforeClass()
{
self::$fixturesPath = __DIR__.'/Fixtures/';

View File

@ -18,13 +18,6 @@ class YamlDumperTest extends \PHPUnit_Framework_TestCase
{
protected static $fixturesPath;
protected function setUp()
{
if (!class_exists('Symfony\Component\Yaml\Yaml')) {
$this->markTestSkipped('The "Yaml" component is not available');
}
}
public static function setUpBeforeClass()
{
self::$fixturesPath = realpath(__DIR__.'/../Fixtures/');

View File

@ -16,13 +16,6 @@ use Symfony\Component\DependencyInjection\Loader\ClosureLoader;
class ClosureLoaderTest extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
if (!class_exists('Symfony\Component\Config\Loader\Loader')) {
$this->markTestSkipped('The "Config" component is not available');
}
}
/**
* @covers Symfony\Component\DependencyInjection\Loader\ClosureLoader::supports
*/

View File

@ -29,10 +29,6 @@ class IniFileLoaderTest extends \PHPUnit_Framework_TestCase
protected function setUp()
{
if (!class_exists('Symfony\Component\Config\Loader\Loader')) {
$this->markTestSkipped('The "Config" component is not available');
}
$this->container = new ContainerBuilder();
$this->loader = new IniFileLoader($this->container, new FileLocator(self::$fixturesPath.'/ini'));
}

View File

@ -18,13 +18,6 @@ use Symfony\Component\Config\FileLocator;
class PhpFileLoaderTest extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
if (!class_exists('Symfony\Component\Config\Loader\Loader')) {
$this->markTestSkipped('The "Config" component is not available');
}
}
/**
* @covers Symfony\Component\DependencyInjection\Loader\PhpFileLoader::supports
*/

View File

@ -25,13 +25,6 @@ class XmlFileLoaderTest extends \PHPUnit_Framework_TestCase
{
protected static $fixturesPath;
protected function setUp()
{
if (!class_exists('Symfony\Component\Config\Loader\Loader')) {
$this->markTestSkipped('The "Config" component is not available');
}
}
public static function setUpBeforeClass()
{
self::$fixturesPath = realpath(__DIR__.'/../Fixtures/');
@ -104,10 +97,6 @@ class XmlFileLoaderTest extends \PHPUnit_Framework_TestCase
public function testLoadImports()
{
if (!class_exists('Symfony\Component\Yaml\Yaml')) {
$this->markTestSkipped('The "Yaml" component is not available');
}
$container = new ContainerBuilder();
$resolver = new LoaderResolver(array(
new IniFileLoader($container, new FileLocator(self::$fixturesPath.'/xml')),

View File

@ -25,17 +25,6 @@ class YamlFileLoaderTest extends \PHPUnit_Framework_TestCase
{
protected static $fixturesPath;
protected function setUp()
{
if (!class_exists('Symfony\Component\Config\Loader\Loader')) {
$this->markTestSkipped('The "Config" component is not available');
}
if (!class_exists('Symfony\Component\Yaml\Yaml')) {
$this->markTestSkipped('The "Yaml" component is not available');
}
}
public static function setUpBeforeClass()
{
self::$fixturesPath = realpath(__DIR__.'/../Fixtures/');

View File

@ -515,10 +515,6 @@ EOF
*/
public function testFilter()
{
if (!class_exists('Symfony\Component\CssSelector\CssSelector')) {
$this->markTestSkipped('The "CssSelector" component is not available');
}
$crawler = $this->createTestCrawler();
$this->assertNotSame($crawler, $crawler->filter('li'), '->filter() returns a new instance of a crawler');
$this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler, '->filter() returns a new instance of a crawler');

View File

@ -19,13 +19,6 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class ContainerAwareEventDispatcherTest extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
if (!class_exists('Symfony\Component\DependencyInjection\Container')) {
$this->markTestSkipped('The "DependencyInjection" component is not available');
}
}
public function testAddAListenerService()
{
$event = new Event();

View File

@ -26,10 +26,6 @@ abstract class FormIntegrationTestCase extends \PHPUnit_Framework_TestCase
protected function setUp()
{
if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) {
$this->markTestSkipped('The "EventDispatcher" component is not available');
}
$this->factory = Forms::createFormFactoryBuilder()
->addExtensions($this->getExtensions())
->getFormFactory();

View File

@ -34,10 +34,6 @@ abstract class AbstractFormTest extends \PHPUnit_Framework_TestCase
protected function setUp()
{
if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) {
$this->markTestSkipped('The "EventDispatcher" component is not available');
}
// We need an actual dispatcher to use the deprecated
// bindRequest() method
$this->dispatcher = new EventDispatcher();

View File

@ -583,10 +583,6 @@ class CompoundFormTest extends AbstractFormTest
*/
public function testSubmitPostOrPutRequest($method)
{
if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
$this->markTestSkipped('The "HttpFoundation" component is not available');
}
$path = tempnam(sys_get_temp_dir(), 'sf2');
touch($path);
@ -635,10 +631,6 @@ class CompoundFormTest extends AbstractFormTest
*/
public function testSubmitPostOrPutRequestWithEmptyRootFormName($method)
{
if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
$this->markTestSkipped('The "HttpFoundation" component is not available');
}
$path = tempnam(sys_get_temp_dir(), 'sf2');
touch($path);
@ -686,10 +678,6 @@ class CompoundFormTest extends AbstractFormTest
*/
public function testSubmitPostOrPutRequestWithSingleChildForm($method)
{
if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
$this->markTestSkipped('The "HttpFoundation" component is not available');
}
$path = tempnam(sys_get_temp_dir(), 'sf2');
touch($path);
@ -726,10 +714,6 @@ class CompoundFormTest extends AbstractFormTest
*/
public function testSubmitPostOrPutRequestWithSingleChildFormUploadedFile($method)
{
if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
$this->markTestSkipped('The "HttpFoundation" component is not available');
}
$path = tempnam(sys_get_temp_dir(), 'sf2');
touch($path);
@ -755,10 +739,6 @@ class CompoundFormTest extends AbstractFormTest
public function testSubmitGetRequest()
{
if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
$this->markTestSkipped('The "HttpFoundation" component is not available');
}
$values = array(
'author' => array(
'firstName' => 'Bernhard',
@ -787,10 +767,6 @@ class CompoundFormTest extends AbstractFormTest
public function testSubmitGetRequestWithEmptyRootFormName()
{
if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
$this->markTestSkipped('The "HttpFoundation" component is not available');
}
$values = array(
'firstName' => 'Bernhard',
'lastName' => 'Schussek',

View File

@ -34,14 +34,6 @@ class PropertyPathMapperTest extends \PHPUnit_Framework_TestCase
protected function setUp()
{
if (!class_exists('Symfony\Component\EventDispatcher\Event')) {
$this->markTestSkipped('The "EventDispatcher" component is not available');
}
if (!class_exists('Symfony\Component\PropertyAccess\PropertyAccess')) {
$this->markTestSkipped('The "PropertyAccess" component is not available');
}
$this->dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface');
$this->propertyAccessor = $this->getMock('Symfony\Component\PropertyAccess\PropertyAccessorInterface');
$this->mapper = new PropertyPathMapper($this->propertyAccessor);

View File

@ -21,10 +21,6 @@ class FixRadioInputListenerTest extends \PHPUnit_Framework_TestCase
protected function setUp()
{
if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) {
$this->markTestSkipped('The "EventDispatcher" component is not available');
}
parent::setUp();
$this->choiceList = new SimpleChoiceList(array('' => 'Empty', 0 => 'A', 1 => 'B'));

View File

@ -16,13 +16,6 @@ use Symfony\Component\Form\Extension\Core\EventListener\FixUrlProtocolListener;
class FixUrlProtocolListenerTest extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) {
$this->markTestSkipped('The "EventDispatcher" component is not available');
}
}
public function testFixHttpUrl()
{
$data = "www.symfony.com";

View File

@ -22,10 +22,6 @@ abstract class MergeCollectionListenerTest extends \PHPUnit_Framework_TestCase
protected function setUp()
{
if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) {
$this->markTestSkipped('The "EventDispatcher" component is not available');
}
$this->dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface');
$this->factory = $this->getMock('Symfony\Component\Form\FormFactoryInterface');
$this->form = $this->getForm('axes');

View File

@ -24,10 +24,6 @@ class ResizeFormListenerTest extends \PHPUnit_Framework_TestCase
protected function setUp()
{
if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) {
$this->markTestSkipped('The "EventDispatcher" component is not available');
}
$this->dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface');
$this->factory = $this->getMock('Symfony\Component\Form\FormFactoryInterface');
$this->form = $this->getBuilder()

View File

@ -16,13 +16,6 @@ use Symfony\Component\Form\Extension\Core\EventListener\TrimListener;
class TrimListenerTest extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) {
$this->markTestSkipped('The "EventDispatcher" component is not available');
}
}
public function testTrim()
{
$data = " Foo! ";

View File

@ -20,10 +20,6 @@ class SessionCsrfProviderTest extends \PHPUnit_Framework_TestCase
protected function setUp()
{
if (!class_exists('Symfony\Component\HttpFoundation\Session\Session')) {
$this->markTestSkipped('The "HttpFoundation" component is not available');
}
$this->session = $this->getMock(
'Symfony\Component\HttpFoundation\Session\Session',
array(),

View File

@ -23,10 +23,6 @@ class CsrfValidationListenerTest extends \PHPUnit_Framework_TestCase
protected function setUp()
{
if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) {
$this->markTestSkipped('The "EventDispatcher" component is not available');
}
$this->dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface');
$this->factory = $this->getMock('Symfony\Component\Form\FormFactoryInterface');
$this->csrfProvider = $this->getMock('Symfony\Component\Form\Extension\Csrf\CsrfProvider\CsrfProviderInterface');

View File

@ -87,10 +87,6 @@ class LegacyBindRequestListenerTest extends \PHPUnit_Framework_TestCase
*/
public function testSubmitRequest($method)
{
if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
$this->markTestSkipped('The "HttpFoundation" component is not available');
}
$values = array('author' => $this->values);
$files = array('author' => $this->filesNested);
$request = new Request(array(), $values, array(), array(), $files, array(
@ -116,10 +112,6 @@ class LegacyBindRequestListenerTest extends \PHPUnit_Framework_TestCase
*/
public function testSubmitRequestWithEmptyName($method)
{
if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
$this->markTestSkipped('The "HttpFoundation" component is not available');
}
$request = new Request(array(), $this->values, array(), array(), $this->filesPlain, array(
'REQUEST_METHOD' => $method,
));
@ -143,10 +135,6 @@ class LegacyBindRequestListenerTest extends \PHPUnit_Framework_TestCase
*/
public function testSubmitEmptyRequestToCompoundForm($method)
{
if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
$this->markTestSkipped('The "HttpFoundation" component is not available');
}
$request = new Request(array(), array(), array(), array(), array(), array(
'REQUEST_METHOD' => $method,
));
@ -170,10 +158,6 @@ class LegacyBindRequestListenerTest extends \PHPUnit_Framework_TestCase
*/
public function testSubmitEmptyRequestToSimpleForm($method)
{
if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
$this->markTestSkipped('The "HttpFoundation" component is not available');
}
$request = new Request(array(), array(), array(), array(), array(), array(
'REQUEST_METHOD' => $method,
));
@ -193,10 +177,6 @@ class LegacyBindRequestListenerTest extends \PHPUnit_Framework_TestCase
public function testSubmitGetRequest()
{
if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
$this->markTestSkipped('The "HttpFoundation" component is not available');
}
$values = array('author' => $this->values);
$request = new Request($values, array(), array(), array(), array(), array(
'REQUEST_METHOD' => 'GET',
@ -218,10 +198,6 @@ class LegacyBindRequestListenerTest extends \PHPUnit_Framework_TestCase
public function testSubmitGetRequestWithEmptyName()
{
if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
$this->markTestSkipped('The "HttpFoundation" component is not available');
}
$request = new Request($this->values, array(), array(), array(), array(), array(
'REQUEST_METHOD' => 'GET',
));
@ -242,10 +218,6 @@ class LegacyBindRequestListenerTest extends \PHPUnit_Framework_TestCase
public function testSubmitEmptyGetRequestToCompoundForm()
{
if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
$this->markTestSkipped('The "HttpFoundation" component is not available');
}
$request = new Request(array(), array(), array(), array(), array(), array(
'REQUEST_METHOD' => 'GET',
));
@ -265,10 +237,6 @@ class LegacyBindRequestListenerTest extends \PHPUnit_Framework_TestCase
public function testSubmitEmptyGetRequestToSimpleForm()
{
if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
$this->markTestSkipped('The "HttpFoundation" component is not available');
}
$request = new Request(array(), array(), array(), array(), array(), array(
'REQUEST_METHOD' => 'GET',
));

View File

@ -53,10 +53,6 @@ class ValidationListenerTest extends \PHPUnit_Framework_TestCase
protected function setUp()
{
if (!class_exists('Symfony\Component\EventDispatcher\Event')) {
$this->markTestSkipped('The "EventDispatcher" component is not available');
}
$this->dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface');
$this->factory = $this->getMock('Symfony\Component\Form\FormFactoryInterface');
$this->validator = $this->getMock('Symfony\Component\Validator\ValidatorInterface');

View File

@ -20,10 +20,6 @@ abstract class TypeTestCase extends BaseTypeTestCase
protected function setUp()
{
if (!class_exists('Symfony\Component\Validator\Constraint')) {
$this->markTestSkipped('The "Validator" component is not available');
}
$this->validator = $this->getMock('Symfony\Component\Validator\ValidatorInterface');
$metadataFactory = $this->getMock('Symfony\Component\Validator\MetadataFactoryInterface');
$this->validator->expects($this->once())->method('getMetadataFactory')->will($this->returnValue($metadataFactory));

View File

@ -50,10 +50,6 @@ class ValidatorTypeGuesserTest extends \PHPUnit_Framework_TestCase
protected function setUp()
{
if (!class_exists('Symfony\Component\Validator\Constraint')) {
$this->markTestSkipped('The "Validator" component is not available');
}
$this->metadata = new ClassMetadata(self::TEST_CLASS);
$this->metadataFactory = $this->getMock('Symfony\Component\Validator\MetadataFactoryInterface');
$this->metadataFactory->expects($this->any())

View File

@ -60,10 +60,6 @@ class ViolationMapperTest extends \PHPUnit_Framework_TestCase
protected function setUp()
{
if (!class_exists('Symfony\Component\EventDispatcher\Event')) {
$this->markTestSkipped('The "EventDispatcher" component is not available');
}
$this->dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface');
$this->mapper = new ViolationMapper();
$this->message = 'Message';

View File

@ -21,10 +21,6 @@ class FormBuilderTest extends \PHPUnit_Framework_TestCase
protected function setUp()
{
if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) {
$this->markTestSkipped('The "EventDispatcher" component is not available');
}
$this->dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface');
$this->factory = $this->getMock('Symfony\Component\Form\FormFactoryInterface');
$this->builder = new FormBuilder('name', null, $this->dispatcher, $this->factory);

View File

@ -52,10 +52,6 @@ class FormFactoryTest extends \PHPUnit_Framework_TestCase
protected function setUp()
{
if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) {
$this->markTestSkipped('The "EventDispatcher" component is not available');
}
$this->resolvedTypeFactory = $this->getMock('Symfony\Component\Form\ResolvedFormTypeFactoryInterface');
$this->guesser1 = $this->getMock('Symfony\Component\Form\FormTypeGuesserInterface');
$this->guesser2 = $this->getMock('Symfony\Component\Form\FormTypeGuesserInterface');

View File

@ -38,14 +38,6 @@ class ResolvedFormTypeTest extends \PHPUnit_Framework_TestCase
protected function setUp()
{
if (!class_exists('Symfony\Component\OptionsResolver\OptionsResolver')) {
$this->markTestSkipped('The "OptionsResolver" component is not available');
}
if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) {
$this->markTestSkipped('The "EventDispatcher" component is not available');
}
$this->dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface');
$this->factory = $this->getMock('Symfony\Component\Form\FormFactoryInterface');
$this->dataMapper = $this->getMock('Symfony\Component\Form\DataMapperInterface');
@ -53,10 +45,6 @@ class ResolvedFormTypeTest extends \PHPUnit_Framework_TestCase
public function testCreateBuilder()
{
if (version_compare(\PHPUnit_Runner_Version::id(), '3.7', '<')) {
$this->markTestSkipped('This test requires PHPUnit 3.7.');
}
$parentType = $this->getMockFormType();
$type = $this->getMockFormType();
$extension1 = $this->getMockFormTypeExtension();

View File

@ -19,18 +19,6 @@ class BundleTest extends \PHPUnit_Framework_TestCase
{
public function testRegisterCommands()
{
if (!class_exists('Symfony\Component\Console\Application')) {
$this->markTestSkipped('The "Console" component is not available');
}
if (!interface_exists('Symfony\Component\DependencyInjection\ContainerAwareInterface')) {
$this->markTestSkipped('The "DependencyInjection" component is not available');
}
if (!class_exists('Symfony\Component\Finder\Finder')) {
$this->markTestSkipped('The "Finder" component is not available');
}
$cmd = new FooCommand();
$app = $this->getMock('Symfony\Component\Console\Application');
$app->expects($this->once())->method('add')->with($this->equalTo($cmd));

View File

@ -20,13 +20,6 @@ use Symfony\Component\HttpKernel\Tests\Fixtures\TestClient;
class ClientTest extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
if (!class_exists('Symfony\Component\BrowserKit\Client')) {
$this->markTestSkipped('The "BrowserKit" component is not available');
}
}
public function testDoRequest()
{
$client = new Client(new TestHttpKernel());
@ -48,14 +41,6 @@ class ClientTest extends \PHPUnit_Framework_TestCase
public function testGetScript()
{
if (!class_exists('Symfony\Component\Process\Process')) {
$this->markTestSkipped('The "Process" component is not available');
}
if (!class_exists('Symfony\Component\ClassLoader\ClassLoader')) {
$this->markTestSkipped('The "ClassLoader" component is not available');
}
$client = new TestClient(new TestHttpKernel());
$client->insulate();
$client->request('GET', '/');

View File

@ -16,13 +16,6 @@ use Symfony\Component\HttpFoundation\Request;
class ControllerResolverTest extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
$this->markTestSkipped('The "HttpFoundation" component is not available');
}
}
public function testGetControllerWithoutControllerParameter()
{
$logger = $this->getMock('Psr\Log\LoggerInterface');

View File

@ -19,13 +19,6 @@ use Symfony\Component\HttpFoundation\Response;
class ConfigDataCollectorTest extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
$this->markTestSkipped('The "HttpFoundation" component is not available');
}
}
public function testCollect()
{
$kernel = new KernelForTest('test', true);

View File

@ -18,13 +18,6 @@ use Symfony\Component\HttpFoundation\Response;
class ExceptionDataCollectorTest extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
$this->markTestSkipped('The "HttpFoundation" component is not available');
}
}
public function testCollect()
{
$e = new \Exception('foo', 500);

View File

@ -18,13 +18,6 @@ use Symfony\Component\HttpFoundation\Response;
class LoggerDataCollectorTest extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
$this->markTestSkipped('The "HttpFoundation" component is not available');
}
}
/**
* @dataProvider getCollectTestData
*/

View File

@ -17,13 +17,6 @@ use Symfony\Component\HttpFoundation\Response;
class MemoryDataCollectorTest extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
$this->markTestSkipped('The "HttpFoundation" component is not available');
}
}
public function testCollect()
{
$collector = new MemoryDataCollector();

View File

@ -22,13 +22,6 @@ use Symfony\Component\EventDispatcher\EventDispatcher;
class RequestDataCollectorTest extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
$this->markTestSkipped('The "HttpFoundation" component is not available');
}
}
/**
* @dataProvider provider
*/

View File

@ -17,13 +17,6 @@ use Symfony\Component\HttpFoundation\Response;
class TimeDataCollectorTest extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
$this->markTestSkipped('The "HttpFoundation" component is not available');
}
}
public function testCollect()
{
$c = new TimeDataCollector();

View File

@ -22,17 +22,6 @@ use Symfony\Component\Stopwatch\Stopwatch;
class TraceableEventDispatcherTest extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) {
$this->markTestSkipped('The "EventDispatcher" component is not available');
}
if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
$this->markTestSkipped('The "HttpFoundation" component is not available');
}
}
public function testAddRemoveListener()
{
$dispatcher = new EventDispatcher();

View File

@ -19,21 +19,6 @@ use Symfony\Component\EventDispatcher\EventDispatcher;
class ContainerAwareHttpKernelTest extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
if (!class_exists('Symfony\Component\DependencyInjection\Container')) {
$this->markTestSkipped('The "DependencyInjection" component is not available');
}
if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) {
$this->markTestSkipped('The "EventDispatcher" component is not available');
}
if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
$this->markTestSkipped('The "HttpFoundation" component is not available');
}
}
/**
* @dataProvider getProviderTypes
*/

View File

@ -15,17 +15,6 @@ use Symfony\Component\HttpKernel\DependencyInjection\MergeExtensionConfiguration
class MergeExtensionConfigurationPassTest extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
if (!class_exists('Symfony\Component\DependencyInjection\Container')) {
$this->markTestSkipped('The "DependencyInjection" component is not available');
}
if (!class_exists('Symfony\Component\Config\FileLocator')) {
$this->markTestSkipped('The "Config" component is not available');
}
}
public function testAutoloadMainExtension()
{
$container = $this->getMock(

View File

@ -22,13 +22,6 @@ use Symfony\Component\EventDispatcher\EventDispatcher;
class EsiListenerTest extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) {
$this->markTestSkipped('The "EventDispatcher" component is not available');
}
}
public function testFilterDoesNothingForSubRequests()
{
$dispatcher = new EventDispatcher();

View File

@ -26,17 +26,6 @@ use Symfony\Component\HttpKernel\Tests\Logger;
*/
class ExceptionListenerTest extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) {
$this->markTestSkipped('The "EventDispatcher" component is not available');
}
if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
$this->markTestSkipped('The "HttpFoundation" component is not available');
}
}
public function testConstruct()
{
$logger = new TestLogger();

View File

@ -19,13 +19,6 @@ use Symfony\Component\HttpKernel\UriSigner;
class FragmentListenerTest extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) {
$this->markTestSkipped('The "EventDispatcher" component is not available');
}
}
public function testOnlyTriggeredOnFragmentRoute()
{
$request = Request::create('http://example.com/foo?_path=foo%3Dbar%26_controller%3Dfoo');

View File

@ -18,13 +18,6 @@ use Symfony\Component\HttpKernel\Event\GetResponseEvent;
class LocaleListenerTest extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) {
$this->markTestSkipped('The "EventDispatcher" component is not available');
}
}
public function testDefaultLocaleWithoutSession()
{
$listener = new LocaleListener('fr');
@ -50,10 +43,6 @@ class LocaleListenerTest extends \PHPUnit_Framework_TestCase
public function testLocaleSetForRoutingContext()
{
if (!class_exists('Symfony\Component\Routing\Router')) {
$this->markTestSkipped('The "Routing" component is not available');
}
// the request context is updated
$context = $this->getMock('Symfony\Component\Routing\RequestContext');
$context->expects($this->once())->method('setParameter')->with('_locale', 'es');

View File

@ -27,10 +27,6 @@ class ResponseListenerTest extends \PHPUnit_Framework_TestCase
protected function setUp()
{
if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) {
$this->markTestSkipped('The "EventDispatcher" component is not available');
}
$this->dispatcher = new EventDispatcher();
$listener = new ResponseListener('UTF-8');
$this->dispatcher->addListener(KernelEvents::RESPONSE, array($listener, 'onKernelResponse'));

View File

@ -19,17 +19,6 @@ use Symfony\Component\Routing\RequestContext;
class RouterListenerTest extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) {
$this->markTestSkipped('The "EventDispatcher" component is not available');
}
if (!class_exists('Symfony\Component\Routing\Router')) {
$this->markTestSkipped('The "Routing" component is not available');
}
}
/**
* @dataProvider getPortData
*/

View File

@ -19,13 +19,6 @@ use Symfony\Component\HttpKernel\UriSigner;
class EsiFragmentRendererTest extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
$this->markTestSkipped('The "HttpFoundation" component is not available');
}
}
public function testRenderFallbackToInlineStrategyIfNoRequest()
{
$strategy = new EsiFragmentRenderer(new Esi(), $this->getInlineStrategy(true));

View File

@ -18,13 +18,6 @@ use Symfony\Component\HttpFoundation\Request;
class HIncludeFragmentRendererTest extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
$this->markTestSkipped('The "HttpFoundation" component is not available');
}
}
/**
* @expectedException \LogicException
*/

View File

@ -21,17 +21,6 @@ use Symfony\Component\EventDispatcher\EventDispatcher;
class InlineFragmentRendererTest extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) {
$this->markTestSkipped('The "EventDispatcher" component is not available');
}
if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
$this->markTestSkipped('The "HttpFoundation" component is not available');
}
}
public function testRender()
{
$strategy = new InlineFragmentRenderer($this->getKernel($this->returnValue(new Response('foo'))));

View File

@ -17,13 +17,6 @@ use Symfony\Component\HttpFoundation\Response;
class EsiTest extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
$this->markTestSkipped('The "HttpFoundation" component is not available');
}
}
public function testHasSurrogateEsiCapability()
{
$esi = new Esi();

View File

@ -17,19 +17,8 @@ use Symfony\Component\HttpFoundation\Response;
class HttpCacheTest extends HttpCacheTestCase
{
protected function setUp()
{
if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
$this->markTestSkipped('The "HttpFoundation" component is not available');
}
}
public function testTerminateDelegatesTerminationOnlyForTerminableInterface()
{
if (!class_exists('Symfony\Component\DependencyInjection\Container')) {
$this->markTestSkipped('The "DependencyInjection" component is not available');
}
$storeMock = $this->getMockBuilder('Symfony\\Component\\HttpKernel\\HttpCache\\StoreInterface')
->disableOriginalConstructor()
->getMock();

View File

@ -31,10 +31,6 @@ class HttpCacheTestCase extends \PHPUnit_Framework_TestCase
protected function setUp()
{
if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
$this->markTestSkipped('The "HttpFoundation" component is not available');
}
$this->kernel = null;
$this->cache = null;

View File

@ -23,10 +23,6 @@ class StoreTest extends \PHPUnit_Framework_TestCase
protected function setUp()
{
if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
$this->markTestSkipped('The "HttpFoundation" component is not available');
}
$this->request = Request::create('/');
$this->response = new Response('hello world', 200, array());

View File

@ -23,17 +23,6 @@ use Symfony\Component\EventDispatcher\EventDispatcher;
class HttpKernelTest extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) {
$this->markTestSkipped('The "EventDispatcher" component is not available');
}
if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
$this->markTestSkipped('The "HttpFoundation" component is not available');
}
}
/**
* @expectedException \RuntimeException
*/

View File

@ -21,13 +21,6 @@ use Symfony\Component\HttpKernel\Tests\Fixtures\FooBarBundle;
class KernelTest extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
if (!class_exists('Symfony\Component\DependencyInjection\Container')) {
$this->markTestSkipped('The "DependencyInjection" component is not available');
}
}
public function testConstructor()
{
$env = 'test_env';
@ -263,11 +256,6 @@ class KernelTest extends \PHPUnit_Framework_TestCase
public function testStripComments()
{
if (!function_exists('token_get_all')) {
$this->markTestSkipped('The function token_get_all() is not available.');
return;
}
$source = <<<'EOF'
<?php

View File

@ -60,10 +60,6 @@ class ProfilerTest extends \PHPUnit_Framework_TestCase
protected function setUp()
{
if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
$this->markTestSkipped('The "HttpFoundation" component is not available');
}
if (!class_exists('SQLite3') && (!class_exists('PDO') || !in_array('sqlite', \PDO::getAvailableDrivers()))) {
$this->markTestSkipped('This test requires SQLite support in your environment');
}

View File

@ -207,10 +207,6 @@ class UrlGeneratorTest extends \PHPUnit_Framework_TestCase
public function testGenerateForRouteWithInvalidOptionalParameterNonStrictWithLogger()
{
if (!interface_exists('Psr\Log\LoggerInterface')) {
$this->markTestSkipped('The "psr/log" package is not available');
}
$routes = $this->getRoutes('test', new Route('/testing/{foo}', array('foo' => '1'), array('foo' => 'd+')));
$logger = $this->getMock('Psr\Log\LoggerInterface');
$logger->expects($this->once())

View File

@ -13,13 +13,6 @@ namespace Symfony\Component\Routing\Tests\Loader;
abstract class AbstractAnnotationLoaderTest extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
if (!class_exists('Doctrine\\Common\\Version')) {
$this->markTestSkipped('Doctrine is not available.');
}
}
public function getReader()
{
return $this->getMockBuilder('Doctrine\Common\Annotations\Reader')

View File

@ -17,13 +17,6 @@ use Symfony\Component\Routing\RouteCollection;
class ClosureLoaderTest extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
if (!class_exists('Symfony\Component\Config\FileLocator')) {
$this->markTestSkipped('The "Config" component is not available');
}
}
public function testSupports()
{
$loader = new ClosureLoader();

View File

@ -16,13 +16,6 @@ use Symfony\Component\Routing\Loader\PhpFileLoader;
class PhpFileLoaderTest extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
if (!class_exists('Symfony\Component\Config\FileLocator')) {
$this->markTestSkipped('The "Config" component is not available');
}
}
public function testSupports()
{
$loader = new PhpFileLoader($this->getMock('Symfony\Component\Config\FileLocator'));

View File

@ -17,13 +17,6 @@ use Symfony\Component\Routing\Tests\Fixtures\CustomXmlFileLoader;
class XmlFileLoaderTest extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
if (!class_exists('Symfony\Component\Config\FileLocator')) {
$this->markTestSkipped('The "Config" component is not available');
}
}
public function testSupports()
{
$loader = new XmlFileLoader($this->getMock('Symfony\Component\Config\FileLocator'));

View File

@ -17,17 +17,6 @@ use Symfony\Component\Config\Resource\FileResource;
class YamlFileLoaderTest extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
if (!class_exists('Symfony\Component\Config\FileLocator')) {
$this->markTestSkipped('The "Config" component is not available');
}
if (!class_exists('Symfony\Component\Yaml\Yaml')) {
$this->markTestSkipped('The "Yaml" component is not available');
}
}
public function testSupports()
{
$loader = new YamlFileLoader($this->getMock('Symfony\Component\Config\FileLocator'));

View File

@ -103,10 +103,6 @@ class RouteCollectionTest extends \PHPUnit_Framework_TestCase
public function testAddCollectionWithResources()
{
if (!class_exists('Symfony\Component\Config\Resource\FileResource')) {
$this->markTestSkipped('The "Config" component is not available');
}
$collection = new RouteCollection();
$collection->addResource($foo = new FileResource(__DIR__.'/Fixtures/foo.xml'));
$collection1 = new RouteCollection();
@ -178,10 +174,6 @@ class RouteCollectionTest extends \PHPUnit_Framework_TestCase
public function testResource()
{
if (!class_exists('Symfony\Component\Config\Resource\FileResource')) {
$this->markTestSkipped('The "Config" component is not available');
}
$collection = new RouteCollection();
$collection->addResource($foo = new FileResource(__DIR__.'/Fixtures/foo.xml'));
$collection->addResource($bar = new FileResource(__DIR__.'/Fixtures/bar.xml'));

View File

@ -32,10 +32,6 @@ class AclProviderBenchmarkTest extends \PHPUnit_Framework_TestCase
protected function setUp()
{
if (!class_exists('Doctrine\DBAL\DriverManager')) {
$this->markTestSkipped('The "Doctrine DBAL" library is not available');
}
try {
$this->con = DriverManager::getConnection(array(
'driver' => 'pdo_mysql',

View File

@ -141,9 +141,6 @@ class AclProviderTest extends \PHPUnit_Framework_TestCase
protected function setUp()
{
if (!class_exists('Doctrine\DBAL\DriverManager')) {
$this->markTestSkipped('The Doctrine2 DBAL is required for this test');
}
if (!class_exists('PDO') || !in_array('sqlite', \PDO::getAvailableDrivers())) {
self::markTestSkipped('This test requires SQLite support in your environment');
}

View File

@ -483,9 +483,6 @@ class MutableAclProviderTest extends \PHPUnit_Framework_TestCase
protected function setUp()
{
if (!class_exists('Doctrine\DBAL\DriverManager')) {
$this->markTestSkipped('The Doctrine2 DBAL is required for this test');
}
if (!class_exists('PDO') || !in_array('sqlite', \PDO::getAvailableDrivers())) {
self::markTestSkipped('This test requires SQLite support in your environment');
}

Some files were not shown because too many files have changed in this diff Show More