merged branch fabpot/tests-simplification (PR #8796)

This PR was merged into the master branch.

Discussion
----------

removed deps checks in unit tests

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

As Composer is now widely used in the PHP world, having to run composer install before running the test suite is expected. This also has the nice benefit of removing a bunch of code, making things easier to maintain (there is only one place to declare a dev dependency), and probably more.

see fabpot/Silex#626 where we did the same a while ago for Silex.

Commits
-------

de50621 removed deps checks in unit tests
This commit is contained in:
Fabien Potencier 2013-08-23 17:27:50 +02:00
commit 1602746548
157 changed files with 6 additions and 1418 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

@ -16,13 +16,6 @@ use Symfony\Component\DependencyInjection\ContainerBuilder;
class RegisterEventListenersAndSubscribersPassTest extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
if (!class_exists('Symfony\Component\DependencyInjection\Container')) {
$this->markTestSkipped('The "DependencyInjection" component is not available');
}
}
public function testProcessEventListenersWithPriorities()
{
$container = $this->createBuilder();

View File

@ -17,21 +17,6 @@ use Doctrine\ORM\EntityManager;
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 EntityManager
*/

View File

@ -35,10 +35,6 @@ class EntityChoiceListTest extends DoctrineOrmTestCase
protected function setUp()
{
if (!class_exists('Symfony\Component\Form\Form')) {
$this->markTestSkipped('The "Form" component is not available');
}
parent::setUp();
$this->em = $this->createTestEntityManager();

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 = DoctrineOrmTestCase::createTestEntityManager();
parent::setUp();

View File

@ -44,22 +44,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 = DoctrineOrmTestCase::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()
{
$this->connection = $this->getMock('Doctrine\DBAL\Driver\Connection');

View File

@ -18,15 +18,6 @@ use Doctrine\ORM\Tools\SchemaTool;
class EntityUserProviderTest extends DoctrineOrmTestCase
{
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 = $this->createTestEntityManager();

View File

@ -26,19 +26,6 @@ use Doctrine\ORM\Tools\SchemaTool;
class UniqueValidatorTest extends DoctrineOrmTestCase
{
protected function setUp()
{
parent::setUp();
if (!class_exists('Symfony\Component\Security\Core\SecurityContext')) {
$this->markTestSkipped('The "Security" component is not available');
}
if (!class_exists('Symfony\Component\Validator\Constraint')) {
$this->markTestSkipped('The "Validator" component is not available');
}
}
protected function createRegistryMock($entityManagerName, $em)
{
$registry = $this->getMock('Doctrine\Common\Persistence\ManagerRegistry');

View File

@ -22,13 +22,6 @@ use Symfony\Component\Console\Output\OutputInterface;
*/
class ConsoleHandlerTest extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
if (!class_exists('Monolog\\Logger')) {
$this->markTestSkipped('Monolog is not available.');
}
}
public function testConstructor()
{
$handler = new ConsoleHandler(null, false);

View File

@ -17,13 +17,6 @@ use Symfony\Component\HttpFoundation\Request;
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,17 +21,6 @@ class ModelChoiceListTest extends Propel1TestCase
{
const ITEM_CLASS = '\Symfony\Bridge\Propel1\Tests\Fixtures\Item';
protected function setUp()
{
if (!class_exists('Symfony\Component\Form\Form')) {
$this->markTestSkipped('The "Form" component is not available');
}
if (!class_exists('Symfony\Component\PropertyAccess\PropertyAccessor')) {
$this->markTestSkipped('The "PropertyAccessor" component is not available');
}
}
public function testEmptyChoicesReturnsEmpty()
{
$choiceList = new ModelChoiceList(

View File

@ -21,12 +21,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
{
protected function setUp()
{
if (!class_exists('\Propel')) {
$this->markTestSkipped('Propel is not available.');
}
}
}

View File

@ -11,20 +11,13 @@
namespace Symfony\Bridge\Twig\Tests\Extension\Fixtures;
// Preventing autoloader throwing E_FATAL when Twig is now available
if (!class_exists('Twig_Environment')) {
class StubFilesystemLoader
class StubFilesystemLoader extends \Twig_Loader_Filesystem
{
protected function findTemplate($name)
{
}
} else {
class StubFilesystemLoader extends \Twig_Loader_Filesystem
{
protected function findTemplate($name)
{
// strip away bundle name
$parts = explode(':', $name);
// strip away bundle name
$parts = explode(':', $name);
return parent::findTemplate(end($parts));
}
return parent::findTemplate(end($parts));
}
}

View File

@ -30,22 +30,6 @@ class FormExtensionDivLayoutTest extends AbstractDivLayoutTest
protected function setUp()
{
if (!class_exists('Symfony\Component\Locale\Locale')) {
$this->markTestSkipped('The "Locale" component is not available');
}
if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) {
$this->markTestSkipped('The "EventDispatcher" component is not available');
}
if (!class_exists('Symfony\Component\Form\Form')) {
$this->markTestSkipped('The "Form" component is not available');
}
if (!class_exists('Twig_Environment')) {
$this->markTestSkipped('Twig is not available.');
}
parent::setUp();
$rendererEngine = new TwigRendererEngine(array(

View File

@ -29,22 +29,6 @@ class FormExtensionTableLayoutTest extends AbstractTableLayoutTest
protected function setUp()
{
if (!class_exists('Symfony\Component\Locale\Locale')) {
$this->markTestSkipped('The "Locale" component is not available');
}
if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) {
$this->markTestSkipped('The "EventDispatcher" component is not available');
}
if (!class_exists('Symfony\Component\Form\Form')) {
$this->markTestSkipped('The "Form" component is not available');
}
if (!class_exists('Twig_Environment')) {
$this->markTestSkipped('Twig is not available.');
}
parent::setUp();
$rendererEngine = new TwigRendererEngine(array(

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

@ -17,15 +17,6 @@ use Symfony\Bridge\Twig\Tests\TestCase;
class StopwatchExtensionTest extends TestCase
{
protected function setUp()
{
parent::setUp();
if (!class_exists('Symfony\Component\Stopwatch\Stopwatch')) {
$this->markTestSkipped('The "Stopwatch" component is not available');
}
}
/**
* @expectedException \Twig_Error_Syntax
*/

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

@ -16,15 +16,6 @@ use Symfony\Bridge\Twig\Node\FormThemeNode;
class FormThemeTest extends TestCase
{
protected function setUp()
{
parent::setUp();
if (version_compare(\Twig_Environment::VERSION, '1.5.0', '<')) {
$this->markTestSkipped('Requires Twig version to be at least 1.5.0.');
}
}
public function testConstructor()
{
$form = new \Twig_Node_Expression_Name('form', 0);

View File

@ -16,15 +16,6 @@ use Symfony\Bridge\Twig\Node\SearchAndRenderBlockNode;
class SearchAndRenderBlockNodeTest extends TestCase
{
protected function setUp()
{
parent::setUp();
if (version_compare(\Twig_Environment::VERSION, '1.5.0', '<')) {
$this->markTestSkipped('Requires Twig version to be at least 1.5.0.');
}
}
public function testCompileWidget()
{
$arguments = new \Twig_Node(array(

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

@ -17,15 +17,6 @@ use Symfony\Bridge\Twig\Node\FormThemeNode;
class FormThemeTokenParserTest extends TestCase
{
protected function setUp()
{
parent::setUp();
if (version_compare(\Twig_Environment::VERSION, '1.5.0', '<')) {
$this->markTestSkipped('Requires Twig version to be at least 1.5.0.');
}
}
/**
* @dataProvider getTestsForFormTheme
*/

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

@ -234,10 +234,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

@ -29,19 +29,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

@ -29,19 +29,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

@ -238,14 +238,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');
@ -257,14 +249,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');
@ -276,14 +260,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');
@ -295,14 +271,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');
@ -475,10 +443,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

@ -757,10 +757,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());
@ -780,10 +776,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);
@ -799,10 +791,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

@ -485,10 +485,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);
@ -515,10 +511,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);
@ -545,10 +537,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');
@ -575,10 +563,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'));
@ -669,10 +653,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());
@ -680,10 +660,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

@ -27,13 +27,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/');
@ -126,10 +119,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

@ -371,10 +371,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

@ -25,10 +25,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

@ -581,10 +581,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);
@ -633,10 +629,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);
@ -684,10 +676,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);
@ -724,10 +712,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);
@ -753,10 +737,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',
@ -785,10 +765,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

@ -23,10 +23,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

@ -86,10 +86,6 @@ class BindRequestListenerTest 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(
@ -115,10 +111,6 @@ class BindRequestListenerTest 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,
));
@ -142,10 +134,6 @@ class BindRequestListenerTest 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,
));
@ -169,10 +157,6 @@ class BindRequestListenerTest 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,
));
@ -192,10 +176,6 @@ class BindRequestListenerTest 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',
@ -217,10 +197,6 @@ class BindRequestListenerTest 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',
));
@ -241,10 +217,6 @@ class BindRequestListenerTest 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',
));
@ -264,10 +236,6 @@ class BindRequestListenerTest 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

@ -49,10 +49,6 @@ class FormValidatorTest 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->serverParams = $this->getMock(

View File

@ -54,10 +54,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

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

@ -23,10 +23,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

@ -53,10 +53,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

@ -39,14 +39,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');

View File

@ -21,18 +21,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

@ -22,13 +22,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());
@ -50,14 +43,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 testGetController()
{
$logger = new Logger();

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('Symfony\\Component\\DependencyInjection\\ContainerBuilder');

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

@ -18,13 +18,6 @@ use Symfony\Component\HttpFoundation\Request;
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

@ -19,19 +19,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

@ -22,13 +22,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';

View File

@ -19,13 +19,6 @@ use Symfony\Component\HttpFoundation\Response;
class ProfilerTest 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()
{
if (!class_exists('SQLite3') && (!class_exists('PDO') || !in_array('sqlite', \PDO::getAvailableDrivers()))) {

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

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