Merge branch '2.3' into 2.7
* 2.3: removed all @covers annotations [PropertyAccess] Major performance improvement
This commit is contained in:
commit
db54164a87
@ -24,9 +24,6 @@ use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
*/
|
||||
class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::createService
|
||||
*/
|
||||
public function testCreateProxyServiceWithRuntimeInstantiator()
|
||||
{
|
||||
$builder = new ContainerBuilder();
|
||||
|
@ -18,8 +18,6 @@ use Symfony\Component\DependencyInjection\Definition;
|
||||
* Tests for {@see \Symfony\Bridge\ProxyManager\LazyProxy\Instantiator\RuntimeInstantiator}.
|
||||
*
|
||||
* @author Marco Pivetta <ocramius@gmail.com>
|
||||
*
|
||||
* @covers \Symfony\Bridge\ProxyManager\LazyProxy\Instantiator\RuntimeInstantiator
|
||||
*/
|
||||
class RuntimeInstantiatorTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
@ -18,8 +18,6 @@ use Symfony\Component\DependencyInjection\Definition;
|
||||
* Tests for {@see \Symfony\Bridge\ProxyManager\LazyProxy\PhpDumper\ProxyDumper}.
|
||||
*
|
||||
* @author Marco Pivetta <ocramius@gmail.com>
|
||||
*
|
||||
* @covers \Symfony\Bridge\ProxyManager\LazyProxy\PhpDumper\ProxyDumper
|
||||
*/
|
||||
class ProxyDumperTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
@ -73,27 +73,18 @@ EOF;
|
||||
|
||||
class ClientTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @covers Symfony\Component\BrowserKit\Client::getHistory
|
||||
*/
|
||||
public function testGetHistory()
|
||||
{
|
||||
$client = new TestClient(array(), $history = new History());
|
||||
$this->assertSame($history, $client->getHistory(), '->getHistory() returns the History');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\BrowserKit\Client::getCookieJar
|
||||
*/
|
||||
public function testGetCookieJar()
|
||||
{
|
||||
$client = new TestClient(array(), null, $cookieJar = new CookieJar());
|
||||
$this->assertSame($cookieJar, $client->getCookieJar(), '->getCookieJar() returns the CookieJar');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\BrowserKit\Client::getRequest
|
||||
*/
|
||||
public function testGetRequest()
|
||||
{
|
||||
$client = new TestClient();
|
||||
@ -140,9 +131,6 @@ class ClientTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals($json, $client->getRequest()->getContent());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\BrowserKit\Client::getCrawler
|
||||
*/
|
||||
public function testGetCrawler()
|
||||
{
|
||||
$client = new TestClient();
|
||||
|
@ -16,19 +16,12 @@ use Symfony\Component\Config\Loader\DelegatingLoader;
|
||||
|
||||
class DelegatingLoaderTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @covers Symfony\Component\Config\Loader\DelegatingLoader::__construct
|
||||
*/
|
||||
public function testConstructor()
|
||||
{
|
||||
$loader = new DelegatingLoader($resolver = new LoaderResolver());
|
||||
$this->assertTrue(true, '__construct() takes a loader resolver as its first argument');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\Config\Loader\DelegatingLoader::getResolver
|
||||
* @covers Symfony\Component\Config\Loader\DelegatingLoader::setResolver
|
||||
*/
|
||||
public function testGetSetResolver()
|
||||
{
|
||||
$resolver = new LoaderResolver();
|
||||
@ -38,9 +31,6 @@ class DelegatingLoaderTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertSame($resolver, $loader->getResolver(), '->setResolver() sets the resolver loader');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\Config\Loader\DelegatingLoader::supports
|
||||
*/
|
||||
public function testSupports()
|
||||
{
|
||||
$loader1 = $this->getMock('Symfony\Component\Config\Loader\LoaderInterface');
|
||||
@ -54,9 +44,6 @@ class DelegatingLoaderTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertFalse($loader->supports('foo.foo'), '->supports() returns false if the resource is not loadable');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\Config\Loader\DelegatingLoader::load
|
||||
*/
|
||||
public function testLoad()
|
||||
{
|
||||
$loader = $this->getMock('Symfony\Component\Config\Loader\LoaderInterface');
|
||||
|
@ -16,9 +16,6 @@ use Symfony\Component\Config\Loader\LoaderResolver;
|
||||
|
||||
class FileLoaderTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @covers Symfony\Component\Config\Loader\FileLoader
|
||||
*/
|
||||
public function testImportWithFileLocatorDelegation()
|
||||
{
|
||||
$locatorMock = $this->getMock('Symfony\Component\Config\FileLocatorInterface');
|
||||
|
@ -15,9 +15,6 @@ use Symfony\Component\Config\Loader\LoaderResolver;
|
||||
|
||||
class LoaderResolverTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @covers Symfony\Component\Config\Loader\LoaderResolver::__construct
|
||||
*/
|
||||
public function testConstructor()
|
||||
{
|
||||
$resolver = new LoaderResolver(array(
|
||||
@ -27,9 +24,6 @@ class LoaderResolverTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals(array($loader), $resolver->getLoaders(), '__construct() takes an array of loaders as its first argument');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\Config\Loader\LoaderResolver::resolve
|
||||
*/
|
||||
public function testResolve()
|
||||
{
|
||||
$loader = $this->getMock('Symfony\Component\Config\Loader\LoaderInterface');
|
||||
@ -42,10 +36,6 @@ class LoaderResolverTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals($loader, $resolver->resolve(function () {}), '->resolve() returns the loader for the given resource');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\Config\Loader\LoaderResolver::getLoaders
|
||||
* @covers Symfony\Component\Config\Loader\LoaderResolver::addLoader
|
||||
*/
|
||||
public function testLoaders()
|
||||
{
|
||||
$resolver = new LoaderResolver();
|
||||
|
@ -16,9 +16,6 @@ use Symfony\Component\Console\Command\Command;
|
||||
|
||||
class HelperSetTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @covers \Symfony\Component\Console\Helper\HelperSet::__construct
|
||||
*/
|
||||
public function testConstructor()
|
||||
{
|
||||
$mock_helper = $this->getGenericMockHelper('fake_helper');
|
||||
@ -28,9 +25,6 @@ class HelperSetTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertTrue($helperset->has('fake_helper_alias'), '__construct sets helper alias for given helper');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Symfony\Component\Console\Helper\HelperSet::set
|
||||
*/
|
||||
public function testSet()
|
||||
{
|
||||
$helperset = new HelperSet();
|
||||
@ -49,9 +43,6 @@ class HelperSetTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertTrue($helperset->has('fake_helper_alias'), '->set() adds helper alias when set');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Symfony\Component\Console\Helper\HelperSet::has
|
||||
*/
|
||||
public function testHas()
|
||||
{
|
||||
$helperset = new HelperSet(array('fake_helper_alias' => $this->getGenericMockHelper('fake_helper')));
|
||||
@ -59,9 +50,6 @@ class HelperSetTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertTrue($helperset->has('fake_helper_alias'), '->has() finds set helper by alias');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Symfony\Component\Console\Helper\HelperSet::get
|
||||
*/
|
||||
public function testGet()
|
||||
{
|
||||
$helper_01 = $this->getGenericMockHelper('fake_helper_01');
|
||||
@ -82,9 +70,6 @@ class HelperSetTest extends \PHPUnit_Framework_TestCase
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Symfony\Component\Console\Helper\HelperSet::setCommand
|
||||
*/
|
||||
public function testSetCommand()
|
||||
{
|
||||
$cmd_01 = new Command('foo');
|
||||
@ -100,9 +85,6 @@ class HelperSetTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals($cmd_02, $helperset->getCommand(), '->setCommand() overwrites stored command with consecutive calls');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Symfony\Component\Console\Helper\HelperSet::getCommand
|
||||
*/
|
||||
public function testGetCommand()
|
||||
{
|
||||
$cmd = new Command('foo');
|
||||
|
@ -30,12 +30,6 @@ use Symfony\Component\ExpressionLanguage\Expression;
|
||||
|
||||
class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::setDefinitions
|
||||
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::getDefinitions
|
||||
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::setDefinition
|
||||
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::getDefinition
|
||||
*/
|
||||
public function testDefinitions()
|
||||
{
|
||||
$builder = new ContainerBuilder();
|
||||
@ -63,9 +57,6 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::register
|
||||
*/
|
||||
public function testRegister()
|
||||
{
|
||||
$builder = new ContainerBuilder();
|
||||
@ -74,9 +65,6 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertInstanceOf('Symfony\Component\DependencyInjection\Definition', $builder->getDefinition('foo'), '->register() returns the newly created Definition instance');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::has
|
||||
*/
|
||||
public function testHas()
|
||||
{
|
||||
$builder = new ContainerBuilder();
|
||||
@ -87,9 +75,6 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertTrue($builder->has('bar'), '->has() returns true if a service exists');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::get
|
||||
*/
|
||||
public function testGet()
|
||||
{
|
||||
$builder = new ContainerBuilder();
|
||||
@ -122,7 +107,6 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Symfony\Component\DependencyInjection\ContainerBuilder::get
|
||||
* @expectedException \Symfony\Component\DependencyInjection\Exception\RuntimeException
|
||||
* @expectedExceptionMessage You have requested a synthetic service ("foo"). The DIC does not know how to construct this service.
|
||||
*/
|
||||
@ -141,9 +125,6 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
$builder->get('foo');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::get
|
||||
*/
|
||||
public function testGetReturnsNullOnInactiveScope()
|
||||
{
|
||||
$builder = new ContainerBuilder();
|
||||
@ -152,9 +133,6 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertNull($builder->get('foo', ContainerInterface::NULL_ON_INVALID_REFERENCE));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::get
|
||||
*/
|
||||
public function testGetReturnsNullOnInactiveScopeWhenServiceIsCreatedByAMethod()
|
||||
{
|
||||
$builder = new ProjectContainer();
|
||||
@ -162,9 +140,6 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertNull($builder->get('foobaz', ContainerInterface::NULL_ON_INVALID_REFERENCE));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::getServiceIds
|
||||
*/
|
||||
public function testGetServiceIds()
|
||||
{
|
||||
$builder = new ContainerBuilder();
|
||||
@ -174,11 +149,6 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals(array('foo', 'bar', 'service_container'), $builder->getServiceIds(), '->getServiceIds() returns all defined service ids');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::setAlias
|
||||
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::hasAlias
|
||||
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::getAlias
|
||||
*/
|
||||
public function testAliases()
|
||||
{
|
||||
$builder = new ContainerBuilder();
|
||||
@ -205,9 +175,6 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::getAliases
|
||||
*/
|
||||
public function testGetAliases()
|
||||
{
|
||||
$builder = new ContainerBuilder();
|
||||
@ -230,9 +197,6 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertCount(0, $builder->getAliases(), '->getAliases() does not return aliased services that have been overridden');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::setAliases
|
||||
*/
|
||||
public function testSetAliases()
|
||||
{
|
||||
$builder = new ContainerBuilder();
|
||||
@ -243,9 +207,6 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertTrue(isset($aliases['foobar']));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::addAliases
|
||||
*/
|
||||
public function testAddAliases()
|
||||
{
|
||||
$builder = new ContainerBuilder();
|
||||
@ -257,10 +218,6 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertTrue(isset($aliases['foobar']));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::addCompilerPass
|
||||
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::getCompilerPassConfig
|
||||
*/
|
||||
public function testAddGetCompilerPass()
|
||||
{
|
||||
$builder = new ContainerBuilder();
|
||||
@ -271,9 +228,6 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertCount(count($builder->getCompiler()->getPassConfig()->getPasses()) - 1, $builderCompilerPasses);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::createService
|
||||
*/
|
||||
public function testCreateService()
|
||||
{
|
||||
$builder = new ContainerBuilder();
|
||||
@ -284,9 +238,6 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertInstanceOf('\Bar\FooClass', $builder->get('foo2'), '->createService() replaces parameters in the file provided by the service definition');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::createService
|
||||
*/
|
||||
public function testCreateProxyWithRealServiceInstantiator()
|
||||
{
|
||||
$builder = new ContainerBuilder();
|
||||
@ -300,9 +251,6 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertSame('Bar\FooClass', get_class($foo1));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::createService
|
||||
*/
|
||||
public function testCreateServiceClass()
|
||||
{
|
||||
$builder = new ContainerBuilder();
|
||||
@ -311,9 +259,6 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertInstanceOf('\stdClass', $builder->get('foo1'), '->createService() replaces parameters in the class provided by the service definition');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::createService
|
||||
*/
|
||||
public function testCreateServiceArguments()
|
||||
{
|
||||
$builder = new ContainerBuilder();
|
||||
@ -323,9 +268,6 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals(array('foo' => 'bar', 'bar' => 'foo', $builder->get('bar'), '%unescape_it%'), $builder->get('foo1')->arguments, '->createService() replaces parameters and service references in the arguments provided by the service definition');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::createService
|
||||
*/
|
||||
public function testCreateServiceFactory()
|
||||
{
|
||||
$builder = new ContainerBuilder();
|
||||
@ -356,9 +298,6 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals(array('foo' => 'bar', 'bar' => 'foo', $builder->get('bar')), $builder->get('foo1')->arguments, '->createService() passes the arguments to the factory method');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::createService
|
||||
*/
|
||||
public function testLegacyCreateServiceFactoryService()
|
||||
{
|
||||
$builder = new ContainerBuilder();
|
||||
@ -372,9 +311,6 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertTrue($builder->get('foo')->called, '->createService() calls the factory method to create the service instance');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::createService
|
||||
*/
|
||||
public function testCreateServiceMethodCalls()
|
||||
{
|
||||
$builder = new ContainerBuilder();
|
||||
@ -384,9 +320,6 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals(array('bar', $builder->get('bar')), $builder->get('foo1')->bar, '->createService() replaces the values in the method calls arguments');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::createService
|
||||
*/
|
||||
public function testCreateServiceConfigurator()
|
||||
{
|
||||
$builder = new ContainerBuilder();
|
||||
@ -414,7 +347,6 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::createService
|
||||
* @expectedException \RuntimeException
|
||||
*/
|
||||
public function testCreateSyntheticService()
|
||||
@ -433,9 +365,6 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals('foobar', $builder->get('foo')->arguments['foo']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::resolveServices
|
||||
*/
|
||||
public function testResolveServices()
|
||||
{
|
||||
$builder = new ContainerBuilder();
|
||||
@ -445,9 +374,6 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals($builder->get('foo'), $builder->resolveServices(new Expression('service("foo")')), '->resolveServices() resolves expressions');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::merge
|
||||
*/
|
||||
public function testMerge()
|
||||
{
|
||||
$container = new ContainerBuilder(new ParameterBag(array('bar' => 'foo')));
|
||||
@ -493,7 +419,6 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::merge
|
||||
* @expectedException \LogicException
|
||||
*/
|
||||
public function testMergeLogicException()
|
||||
@ -504,9 +429,6 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
$container->merge(new ContainerBuilder());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::findTaggedServiceIds
|
||||
*/
|
||||
public function testfindTaggedServiceIds()
|
||||
{
|
||||
$builder = new ContainerBuilder();
|
||||
@ -525,9 +447,6 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals(array(), $builder->findTaggedServiceIds('foobar'), '->findTaggedServiceIds() returns an empty array if there is annotated services');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::findDefinition
|
||||
*/
|
||||
public function testFindDefinition()
|
||||
{
|
||||
$container = new ContainerBuilder();
|
||||
@ -537,9 +456,6 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals($definition, $container->findDefinition('foobar'), '->findDefinition() returns a Definition');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::addObjectResource
|
||||
*/
|
||||
public function testAddObjectResource()
|
||||
{
|
||||
$container = new ContainerBuilder();
|
||||
@ -563,9 +479,6 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertSame(realpath(__DIR__.'/Fixtures/includes/classes.php'), realpath($resource->getResource()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::addClassResource
|
||||
*/
|
||||
public function testAddClassResource()
|
||||
{
|
||||
$container = new ContainerBuilder();
|
||||
@ -589,9 +502,6 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertSame(realpath(__DIR__.'/Fixtures/includes/classes.php'), realpath($resource->getResource()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::compile
|
||||
*/
|
||||
public function testCompilesClassDefinitionsOfLazyServices()
|
||||
{
|
||||
$container = new ContainerBuilder();
|
||||
@ -614,10 +524,6 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertNotEmpty($matchingResources);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::getResources
|
||||
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::addResource
|
||||
*/
|
||||
public function testResources()
|
||||
{
|
||||
$container = new ContainerBuilder();
|
||||
@ -634,10 +540,6 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals(array(), $container->getResources());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::registerExtension
|
||||
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::getExtension
|
||||
*/
|
||||
public function testExtension()
|
||||
{
|
||||
$container = new ContainerBuilder();
|
||||
@ -789,10 +691,6 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
$container->setDefinition('a', new Definition());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::getExtensionConfig
|
||||
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::prependExtensionConfig
|
||||
*/
|
||||
public function testExtensionConfig()
|
||||
{
|
||||
$container = new ContainerBuilder();
|
||||
|
@ -19,9 +19,6 @@ use Symfony\Component\DependencyInjection\Exception\InactiveScopeException;
|
||||
|
||||
class ContainerTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\Container::__construct
|
||||
*/
|
||||
public function testConstructor()
|
||||
{
|
||||
$sc = new Container();
|
||||
@ -75,9 +72,6 @@ class ContainerTest extends \PHPUnit_Framework_TestCase
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\Container::compile
|
||||
*/
|
||||
public function testCompile()
|
||||
{
|
||||
$sc = new Container(new ParameterBag(array('foo' => 'bar')));
|
||||
@ -88,9 +82,6 @@ class ContainerTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals(array('foo' => 'bar'), $sc->getParameterBag()->all(), '->compile() copies the current parameters to the new parameter bag');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\Container::isFrozen
|
||||
*/
|
||||
public function testIsFrozen()
|
||||
{
|
||||
$sc = new Container(new ParameterBag(array('foo' => 'bar')));
|
||||
@ -99,19 +90,12 @@ class ContainerTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertTrue($sc->isFrozen(), '->isFrozen() returns true if the parameters are frozen');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\Container::getParameterBag
|
||||
*/
|
||||
public function testGetParameterBag()
|
||||
{
|
||||
$sc = new Container();
|
||||
$this->assertEquals(array(), $sc->getParameterBag()->all(), '->getParameterBag() returns an empty array if no parameter has been defined');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\Container::setParameter
|
||||
* @covers Symfony\Component\DependencyInjection\Container::getParameter
|
||||
*/
|
||||
public function testGetSetParameter()
|
||||
{
|
||||
$sc = new Container(new ParameterBag(array('foo' => 'bar')));
|
||||
@ -134,9 +118,6 @@ class ContainerTest extends \PHPUnit_Framework_TestCase
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\Container::getServiceIds
|
||||
*/
|
||||
public function testGetServiceIds()
|
||||
{
|
||||
$sc = new Container();
|
||||
@ -149,9 +130,6 @@ class ContainerTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals(array('scoped', 'scoped_foo', 'scoped_synchronized_foo', 'inactive', 'bar', 'foo_bar', 'foo.baz', 'circular', 'throw_exception', 'throws_exception_on_service_configuration', 'service_container', 'foo'), $sc->getServiceIds(), '->getServiceIds() returns defined service ids by getXXXService() methods, followed by service ids defined by set()');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\Container::set
|
||||
*/
|
||||
public function testSet()
|
||||
{
|
||||
$sc = new Container();
|
||||
@ -159,9 +137,6 @@ class ContainerTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals($foo, $sc->get('foo'), '->set() sets a service');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\Container::set
|
||||
*/
|
||||
public function testSetWithNullResetTheService()
|
||||
{
|
||||
$sc = new Container();
|
||||
@ -209,9 +184,6 @@ class ContainerTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertTrue($c->synchronized, '->set() calls synchronize*Service() if it is defined for the service');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\Container::get
|
||||
*/
|
||||
public function testGet()
|
||||
{
|
||||
$sc = new ProjectServiceContainer();
|
||||
@ -271,18 +243,12 @@ class ContainerTest extends \PHPUnit_Framework_TestCase
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\Container::get
|
||||
*/
|
||||
public function testGetReturnsNullOnInactiveScope()
|
||||
{
|
||||
$sc = new ProjectServiceContainer();
|
||||
$this->assertNull($sc->get('inactive', ContainerInterface::NULL_ON_INVALID_REFERENCE));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\Container::has
|
||||
*/
|
||||
public function testHas()
|
||||
{
|
||||
$sc = new ProjectServiceContainer();
|
||||
@ -295,9 +261,6 @@ class ContainerTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertTrue($sc->has('foo\\baz'), '->has() returns true if a get*Method() is defined');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\Container::initialized
|
||||
*/
|
||||
public function testInitialized()
|
||||
{
|
||||
$sc = new ProjectServiceContainer();
|
||||
|
@ -15,9 +15,6 @@ use Symfony\Component\DependencyInjection\Definition;
|
||||
|
||||
class DefinitionTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\Definition::__construct
|
||||
*/
|
||||
public function testConstructor()
|
||||
{
|
||||
$def = new Definition('stdClass');
|
||||
@ -42,10 +39,6 @@ class DefinitionTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals(array('Foo', 'bar'), $def->getFactory(), '->setFactory() converts string static method call to the array');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\Definition::setClass
|
||||
* @covers Symfony\Component\DependencyInjection\Definition::getClass
|
||||
*/
|
||||
public function testSetGetClass()
|
||||
{
|
||||
$def = new Definition('stdClass');
|
||||
@ -73,11 +66,6 @@ class DefinitionTest extends \PHPUnit_Framework_TestCase
|
||||
$def->setDecoratedService('foo', 'foo');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\Definition::setArguments
|
||||
* @covers Symfony\Component\DependencyInjection\Definition::getArguments
|
||||
* @covers Symfony\Component\DependencyInjection\Definition::addArgument
|
||||
*/
|
||||
public function testArguments()
|
||||
{
|
||||
$def = new Definition('stdClass');
|
||||
@ -87,12 +75,6 @@ class DefinitionTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals(array('foo', 'bar'), $def->getArguments(), '->addArgument() adds an argument');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\Definition::setMethodCalls
|
||||
* @covers Symfony\Component\DependencyInjection\Definition::addMethodCall
|
||||
* @covers Symfony\Component\DependencyInjection\Definition::hasMethodCall
|
||||
* @covers Symfony\Component\DependencyInjection\Definition::removeMethodCall
|
||||
*/
|
||||
public function testMethodCalls()
|
||||
{
|
||||
$def = new Definition('stdClass');
|
||||
@ -116,10 +98,6 @@ class DefinitionTest extends \PHPUnit_Framework_TestCase
|
||||
$def->addMethodCall('');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\Definition::setFile
|
||||
* @covers Symfony\Component\DependencyInjection\Definition::getFile
|
||||
*/
|
||||
public function testSetGetFile()
|
||||
{
|
||||
$def = new Definition('stdClass');
|
||||
@ -127,10 +105,6 @@ class DefinitionTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals('foo', $def->getFile(), '->getFile() returns the file to include');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\Definition::setScope
|
||||
* @covers Symfony\Component\DependencyInjection\Definition::getScope
|
||||
*/
|
||||
public function testSetGetScope()
|
||||
{
|
||||
$def = new Definition('stdClass');
|
||||
@ -139,10 +113,6 @@ class DefinitionTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals('foo', $def->getScope());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\Definition::setPublic
|
||||
* @covers Symfony\Component\DependencyInjection\Definition::isPublic
|
||||
*/
|
||||
public function testSetIsPublic()
|
||||
{
|
||||
$def = new Definition('stdClass');
|
||||
@ -151,10 +121,6 @@ class DefinitionTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertFalse($def->isPublic(), '->isPublic() returns false if the instance must not be public.');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\Definition::setSynthetic
|
||||
* @covers Symfony\Component\DependencyInjection\Definition::isSynthetic
|
||||
*/
|
||||
public function testSetIsSynthetic()
|
||||
{
|
||||
$def = new Definition('stdClass');
|
||||
@ -164,8 +130,6 @@ class DefinitionTest extends \PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\Definition::setSynchronized
|
||||
* @covers Symfony\Component\DependencyInjection\Definition::isSynchronized
|
||||
* @group legacy
|
||||
*/
|
||||
public function testLegacySetIsSynchronized()
|
||||
@ -176,10 +140,6 @@ class DefinitionTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertTrue($def->isSynchronized(), '->isSynchronized() returns true if the service is synchronized.');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\Definition::setLazy
|
||||
* @covers Symfony\Component\DependencyInjection\Definition::isLazy
|
||||
*/
|
||||
public function testSetIsLazy()
|
||||
{
|
||||
$def = new Definition('stdClass');
|
||||
@ -188,10 +148,6 @@ class DefinitionTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertTrue($def->isLazy(), '->isLazy() returns true if the service is lazy.');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\Definition::setAbstract
|
||||
* @covers Symfony\Component\DependencyInjection\Definition::isAbstract
|
||||
*/
|
||||
public function testSetIsAbstract()
|
||||
{
|
||||
$def = new Definition('stdClass');
|
||||
@ -200,10 +156,6 @@ class DefinitionTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertTrue($def->isAbstract(), '->isAbstract() returns true if the instance must not be public.');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\Definition::setConfigurator
|
||||
* @covers Symfony\Component\DependencyInjection\Definition::getConfigurator
|
||||
*/
|
||||
public function testSetGetConfigurator()
|
||||
{
|
||||
$def = new Definition('stdClass');
|
||||
@ -211,9 +163,6 @@ class DefinitionTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals('foo', $def->getConfigurator(), '->getConfigurator() returns the configurator');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\Definition::clearTags
|
||||
*/
|
||||
public function testClearTags()
|
||||
{
|
||||
$def = new Definition('stdClass');
|
||||
@ -223,9 +172,6 @@ class DefinitionTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals(array(), $def->getTags(), '->clearTags() removes all current tags');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\Definition::clearTags
|
||||
*/
|
||||
public function testClearTag()
|
||||
{
|
||||
$def = new Definition('stdClass');
|
||||
@ -242,12 +188,6 @@ class DefinitionTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertTrue($def->hasTag('3foo3'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\Definition::addTag
|
||||
* @covers Symfony\Component\DependencyInjection\Definition::getTag
|
||||
* @covers Symfony\Component\DependencyInjection\Definition::getTags
|
||||
* @covers Symfony\Component\DependencyInjection\Definition::hasTag
|
||||
*/
|
||||
public function testTags()
|
||||
{
|
||||
$def = new Definition('stdClass');
|
||||
@ -265,9 +205,6 @@ class DefinitionTest extends \PHPUnit_Framework_TestCase
|
||||
), '->getTags() returns all tags');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\Definition::replaceArgument
|
||||
*/
|
||||
public function testSetArgument()
|
||||
{
|
||||
$def = new Definition('stdClass');
|
||||
|
@ -18,8 +18,6 @@ use Symfony\Component\DependencyInjection\LazyProxy\Instantiator\RealServiceInst
|
||||
* Tests for {@see \Symfony\Component\DependencyInjection\Instantiator\RealServiceInstantiator}.
|
||||
*
|
||||
* @author Marco Pivetta <ocramius@gmail.com>
|
||||
*
|
||||
* @covers \Symfony\Component\DependencyInjection\LazyProxy\Instantiator\RealServiceInstantiator
|
||||
*/
|
||||
class RealServiceInstantiatorTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
@ -18,8 +18,6 @@ use Symfony\Component\DependencyInjection\LazyProxy\PhpDumper\NullDumper;
|
||||
* Tests for {@see \Symfony\Component\DependencyInjection\PhpDumper\NullDumper}.
|
||||
*
|
||||
* @author Marco Pivetta <ocramius@gmail.com>
|
||||
*
|
||||
* @covers \Symfony\Component\DependencyInjection\LazyProxy\PhpDumper\NullDumper
|
||||
*/
|
||||
class NullDumperTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
@ -16,9 +16,6 @@ use Symfony\Component\DependencyInjection\Loader\ClosureLoader;
|
||||
|
||||
class ClosureLoaderTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\Loader\ClosureLoader::supports
|
||||
*/
|
||||
public function testSupports()
|
||||
{
|
||||
$loader = new ClosureLoader(new ContainerBuilder());
|
||||
@ -27,9 +24,6 @@ class ClosureLoaderTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertFalse($loader->supports('foo.foo'), '->supports() returns true if the resource is loadable');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\Loader\ClosureLoader::load
|
||||
*/
|
||||
public function testLoad()
|
||||
{
|
||||
$loader = new ClosureLoader($container = new ContainerBuilder());
|
||||
|
@ -33,10 +33,6 @@ class IniFileLoaderTest extends \PHPUnit_Framework_TestCase
|
||||
$this->loader = new IniFileLoader($this->container, new FileLocator(self::$fixturesPath.'/ini'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\Loader\IniFileLoader::__construct
|
||||
* @covers Symfony\Component\DependencyInjection\Loader\IniFileLoader::load
|
||||
*/
|
||||
public function testIniFileCanBeLoaded()
|
||||
{
|
||||
$this->loader->load('parameters.ini');
|
||||
@ -44,9 +40,6 @@ class IniFileLoaderTest extends \PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\Loader\IniFileLoader::__construct
|
||||
* @covers Symfony\Component\DependencyInjection\Loader\IniFileLoader::load
|
||||
*
|
||||
* @expectedException \InvalidArgumentException
|
||||
* @expectedExceptionMessage The file "foo.ini" does not exist (in:
|
||||
*/
|
||||
@ -56,9 +49,6 @@ class IniFileLoaderTest extends \PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\Loader\IniFileLoader::__construct
|
||||
* @covers Symfony\Component\DependencyInjection\Loader\IniFileLoader::load
|
||||
*
|
||||
* @expectedException \InvalidArgumentException
|
||||
* @expectedExceptionMessage The "nonvalid.ini" file is not valid.
|
||||
*/
|
||||
@ -67,9 +57,6 @@ class IniFileLoaderTest extends \PHPUnit_Framework_TestCase
|
||||
@$this->loader->load('nonvalid.ini');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\Loader\IniFileLoader::supports
|
||||
*/
|
||||
public function testSupports()
|
||||
{
|
||||
$loader = new IniFileLoader(new ContainerBuilder(), new FileLocator());
|
||||
|
@ -17,9 +17,6 @@ use Symfony\Component\Config\FileLocator;
|
||||
|
||||
class PhpFileLoaderTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\Loader\PhpFileLoader::supports
|
||||
*/
|
||||
public function testSupports()
|
||||
{
|
||||
$loader = new PhpFileLoader(new ContainerBuilder(), new FileLocator());
|
||||
@ -28,9 +25,6 @@ class PhpFileLoaderTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertFalse($loader->supports('foo.foo'), '->supports() returns true if the resource is loadable');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\Loader\PhpFileLoader::load
|
||||
*/
|
||||
public function testLoad()
|
||||
{
|
||||
$loader = new PhpFileLoader($container = new ContainerBuilder(), new FileLocator());
|
||||
|
@ -390,9 +390,6 @@ class XmlFileLoaderTest extends \PHPUnit_Framework_TestCase
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\Loader\XmlFileLoader::supports
|
||||
*/
|
||||
public function testSupports()
|
||||
{
|
||||
$loader = new XmlFileLoader(new ContainerBuilder(), new FileLocator());
|
||||
|
@ -211,9 +211,6 @@ class YamlFileLoaderTest extends \PHPUnit_Framework_TestCase
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\Loader\YamlFileLoader::supports
|
||||
*/
|
||||
public function testSupports()
|
||||
{
|
||||
$loader = new YamlFileLoader(new ContainerBuilder(), new FileLocator());
|
||||
|
@ -15,9 +15,6 @@ use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
|
||||
|
||||
class FrozenParameterBagTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag::__construct
|
||||
*/
|
||||
public function testConstructor()
|
||||
{
|
||||
$parameters = array(
|
||||
@ -29,7 +26,6 @@ class FrozenParameterBagTest extends \PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag::clear
|
||||
* @expectedException \LogicException
|
||||
*/
|
||||
public function testClear()
|
||||
@ -39,7 +35,6 @@ class FrozenParameterBagTest extends \PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag::set
|
||||
* @expectedException \LogicException
|
||||
*/
|
||||
public function testSet()
|
||||
@ -49,7 +44,6 @@ class FrozenParameterBagTest extends \PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag::add
|
||||
* @expectedException \LogicException
|
||||
*/
|
||||
public function testAdd()
|
||||
|
@ -18,9 +18,6 @@ use Symfony\Component\DependencyInjection\Exception\RuntimeException;
|
||||
|
||||
class ParameterBagTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag::__construct
|
||||
*/
|
||||
public function testConstructor()
|
||||
{
|
||||
$bag = new ParameterBag($parameters = array(
|
||||
@ -30,9 +27,6 @@ class ParameterBagTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals($parameters, $bag->all(), '__construct() takes an array of parameters as its first argument');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag::clear
|
||||
*/
|
||||
public function testClear()
|
||||
{
|
||||
$bag = new ParameterBag($parameters = array(
|
||||
@ -43,9 +37,6 @@ class ParameterBagTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals(array(), $bag->all(), '->clear() removes all parameters');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag::remove
|
||||
*/
|
||||
public function testRemove()
|
||||
{
|
||||
$bag = new ParameterBag(array(
|
||||
@ -58,10 +49,6 @@ class ParameterBagTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals(array(), $bag->all(), '->remove() converts key to lowercase before removing');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag::get
|
||||
* @covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag::set
|
||||
*/
|
||||
public function testGetSet()
|
||||
{
|
||||
$bag = new ParameterBag(array('foo' => 'bar'));
|
||||
@ -117,9 +104,6 @@ class ParameterBagTest extends \PHPUnit_Framework_TestCase
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag::has
|
||||
*/
|
||||
public function testHas()
|
||||
{
|
||||
$bag = new ParameterBag(array('foo' => 'bar'));
|
||||
@ -128,9 +112,6 @@ class ParameterBagTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertFalse($bag->has('bar'), '->has() returns false if a parameter is not defined');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag::resolveValue
|
||||
*/
|
||||
public function testResolveValue()
|
||||
{
|
||||
$bag = new ParameterBag(array());
|
||||
@ -198,9 +179,6 @@ class ParameterBagTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals('foo.bar:1337', $bag->resolveValue('%host%:%port%'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag::resolve
|
||||
*/
|
||||
public function testResolveIndicatesWhyAParameterIsNeeded()
|
||||
{
|
||||
$bag = new ParameterBag(array('foo' => '%bar%'));
|
||||
@ -220,9 +198,6 @@ class ParameterBagTest extends \PHPUnit_Framework_TestCase
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag::resolve
|
||||
*/
|
||||
public function testResolveUnescapesValue()
|
||||
{
|
||||
$bag = new ParameterBag(array(
|
||||
@ -236,9 +211,6 @@ class ParameterBagTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals(array('bar' => array('ding' => 'I\'m a bar %foo %bar')), $bag->get('foo'), '->resolveValue() supports % escaping by doubling it');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag::escapeValue
|
||||
*/
|
||||
public function testEscapeValue()
|
||||
{
|
||||
$bag = new ParameterBag();
|
||||
@ -253,7 +225,6 @@ class ParameterBagTest extends \PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag::resolve
|
||||
* @dataProvider stringsWithSpacesProvider
|
||||
*/
|
||||
public function testResolveStringWithSpacesReturnsString($expected, $test, $description)
|
||||
|
@ -15,9 +15,6 @@ use Symfony\Component\DependencyInjection\Parameter;
|
||||
|
||||
class ParameterTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\Parameter::__construct
|
||||
*/
|
||||
public function testConstructor()
|
||||
{
|
||||
$ref = new Parameter('foo');
|
||||
|
@ -15,9 +15,6 @@ use Symfony\Component\DependencyInjection\Reference;
|
||||
|
||||
class ReferenceTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\Reference::__construct
|
||||
*/
|
||||
public function testConstructor()
|
||||
{
|
||||
$ref = new Reference('foo');
|
||||
|
@ -25,9 +25,6 @@ class CrawlerTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertCount(1, $crawler, '__construct() takes a node as a first argument');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DomCrawler\Crawler::add
|
||||
*/
|
||||
public function testAdd()
|
||||
{
|
||||
$crawler = new Crawler();
|
||||
@ -63,9 +60,6 @@ class CrawlerTest extends \PHPUnit_Framework_TestCase
|
||||
$crawler->add(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DomCrawler\Crawler::addHtmlContent
|
||||
*/
|
||||
public function testAddHtmlContent()
|
||||
{
|
||||
$crawler = new Crawler();
|
||||
@ -80,7 +74,6 @@ class CrawlerTest extends \PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DomCrawler\Crawler::addHtmlContent
|
||||
* @requires extension mbstring
|
||||
*/
|
||||
public function testAddHtmlContentCharset()
|
||||
@ -91,9 +84,6 @@ class CrawlerTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals('Tiếng Việt', $crawler->filterXPath('//div')->text());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DomCrawler\Crawler::addHtmlContent
|
||||
*/
|
||||
public function testAddHtmlContentInvalidBaseTag()
|
||||
{
|
||||
$crawler = new Crawler(null, 'http://symfony.com');
|
||||
@ -103,9 +93,6 @@ class CrawlerTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals('http://symfony.com/contact', current($crawler->filterXPath('//a')->links())->getUri(), '->addHtmlContent() correctly handles a non-existent base tag href attribute');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DomCrawler\Crawler::addHtmlContent
|
||||
*/
|
||||
public function testAddHtmlContentUnsupportedCharset()
|
||||
{
|
||||
$crawler = new Crawler();
|
||||
@ -115,7 +102,6 @@ class CrawlerTest extends \PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DomCrawler\Crawler::addHtmlContent
|
||||
* @requires extension mbstring
|
||||
*/
|
||||
public function testAddHtmlContentCharsetGbk()
|
||||
@ -127,9 +113,6 @@ class CrawlerTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals('中文', $crawler->filterXPath('//p')->text());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DomCrawler\Crawler::addHtmlContent
|
||||
*/
|
||||
public function testAddHtmlContentWithErrors()
|
||||
{
|
||||
$internalErrors = libxml_use_internal_errors(true);
|
||||
@ -155,9 +138,6 @@ EOF
|
||||
libxml_use_internal_errors($internalErrors);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DomCrawler\Crawler::addXmlContent
|
||||
*/
|
||||
public function testAddXmlContent()
|
||||
{
|
||||
$crawler = new Crawler();
|
||||
@ -166,9 +146,6 @@ EOF
|
||||
$this->assertEquals('foo', $crawler->filterXPath('//div')->attr('class'), '->addXmlContent() adds nodes from an XML string');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DomCrawler\Crawler::addXmlContent
|
||||
*/
|
||||
public function testAddXmlContentCharset()
|
||||
{
|
||||
$crawler = new Crawler();
|
||||
@ -177,9 +154,6 @@ EOF
|
||||
$this->assertEquals('Tiếng Việt', $crawler->filterXPath('//div')->text());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DomCrawler\Crawler::addXmlContent
|
||||
*/
|
||||
public function testAddXmlContentWithErrors()
|
||||
{
|
||||
$internalErrors = libxml_use_internal_errors(true);
|
||||
@ -203,9 +177,6 @@ EOF
|
||||
libxml_use_internal_errors($internalErrors);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DomCrawler\Crawler::addContent
|
||||
*/
|
||||
public function testAddContent()
|
||||
{
|
||||
$crawler = new Crawler();
|
||||
@ -241,9 +212,6 @@ EOF
|
||||
$this->assertEquals('日本語', $crawler->filterXPath('//body')->text(), '->addContent() can recognize "Shift_JIS" in html5 meta charset tag');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DomCrawler\Crawler::addDocument
|
||||
*/
|
||||
public function testAddDocument()
|
||||
{
|
||||
$crawler = new Crawler();
|
||||
@ -252,9 +220,6 @@ EOF
|
||||
$this->assertEquals('foo', $crawler->filterXPath('//div')->attr('class'), '->addDocument() adds nodes from a \DOMDocument');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DomCrawler\Crawler::addNodeList
|
||||
*/
|
||||
public function testAddNodeList()
|
||||
{
|
||||
$crawler = new Crawler();
|
||||
@ -263,9 +228,6 @@ EOF
|
||||
$this->assertEquals('foo', $crawler->filterXPath('//div')->attr('class'), '->addNodeList() adds nodes from a \DOMNodeList');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DomCrawler\Crawler::addNodes
|
||||
*/
|
||||
public function testAddNodes()
|
||||
{
|
||||
foreach ($this->createNodeList() as $node) {
|
||||
@ -278,9 +240,6 @@ EOF
|
||||
$this->assertEquals('foo', $crawler->filterXPath('//div')->attr('class'), '->addNodes() adds nodes from an array of nodes');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DomCrawler\Crawler::addNode
|
||||
*/
|
||||
public function testAddNode()
|
||||
{
|
||||
$crawler = new Crawler();
|
||||
@ -430,9 +389,6 @@ EOF
|
||||
$this->assertCount(7, $crawler->filterXPath('( ( //a | //div )//img | //ul )'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DomCrawler\Crawler::filterXPath
|
||||
*/
|
||||
public function testFilterXPath()
|
||||
{
|
||||
$crawler = $this->createTestCrawler();
|
||||
@ -595,9 +551,6 @@ EOF
|
||||
$this->assertCount(9, $crawler->filterXPath('self::*/a'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DomCrawler\Crawler::filter
|
||||
*/
|
||||
public function testFilter()
|
||||
{
|
||||
$crawler = $this->createTestCrawler();
|
||||
|
@ -41,7 +41,6 @@ class CookieTest extends \PHPUnit_Framework_TestCase
|
||||
/**
|
||||
* @dataProvider invalidNames
|
||||
* @expectedException \InvalidArgumentException
|
||||
* @covers Symfony\Component\HttpFoundation\Cookie::__construct
|
||||
*/
|
||||
public function testInstantiationThrowsExceptionIfCookieNameContainsInvalidCharacters($name)
|
||||
{
|
||||
@ -56,9 +55,6 @@ class CookieTest extends \PHPUnit_Framework_TestCase
|
||||
$cookie = new Cookie('MyCookie', 'foo', 'bar');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\HttpFoundation\Cookie::getValue
|
||||
*/
|
||||
public function testGetValue()
|
||||
{
|
||||
$value = 'MyValue';
|
||||
|
@ -15,9 +15,6 @@ use Symfony\Component\HttpFoundation\HeaderBag;
|
||||
|
||||
class HeaderBagTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @covers Symfony\Component\HttpFoundation\HeaderBag::__construct
|
||||
*/
|
||||
public function testConstructor()
|
||||
{
|
||||
$bag = new HeaderBag(array('foo' => 'bar'));
|
||||
@ -67,9 +64,6 @@ class HeaderBagTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals('#a', $bag->getCacheControlDirective('public'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\HttpFoundation\HeaderBag::all
|
||||
*/
|
||||
public function testAll()
|
||||
{
|
||||
$bag = new HeaderBag(array('foo' => 'bar'));
|
||||
@ -79,9 +73,6 @@ class HeaderBagTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals(array('foo' => array('BAR')), $bag->all(), '->all() gets all the input key are lower case');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\HttpFoundation\HeaderBag::replace
|
||||
*/
|
||||
public function testReplace()
|
||||
{
|
||||
$bag = new HeaderBag(array('foo' => 'bar'));
|
||||
@ -91,9 +82,6 @@ class HeaderBagTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertFalse($bag->has('foo'), '->replace() overrides previously set the input');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\HttpFoundation\HeaderBag::get
|
||||
*/
|
||||
public function testGet()
|
||||
{
|
||||
$bag = new HeaderBag(array('foo' => 'bar', 'fuzz' => 'bizz'));
|
||||
@ -119,9 +107,6 @@ class HeaderBagTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals(array('value'), $bag->get('foo', 'nope', false), 'assoc indices of multi-valued headers are ignored');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\HttpFoundation\HeaderBag::contains
|
||||
*/
|
||||
public function testContains()
|
||||
{
|
||||
$bag = new HeaderBag(array('foo' => 'bar', 'fuzz' => 'bizz'));
|
||||
@ -186,9 +171,6 @@ class HeaderBagTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals(10, $bag->getCacheControlDirective('max-age'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\HttpFoundation\HeaderBag::getIterator
|
||||
*/
|
||||
public function testGetIterator()
|
||||
{
|
||||
$headers = array('foo' => 'bar', 'hello' => 'world', 'third' => 'charm');
|
||||
@ -203,9 +185,6 @@ class HeaderBagTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals(count($headers), $i);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\HttpFoundation\HeaderBag::count
|
||||
*/
|
||||
public function testCount()
|
||||
{
|
||||
$headers = array('foo' => 'bar', 'HELLO' => 'WORLD');
|
||||
|
@ -15,17 +15,11 @@ use Symfony\Component\HttpFoundation\ParameterBag;
|
||||
|
||||
class ParameterBagTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @covers Symfony\Component\HttpFoundation\ParameterBag::__construct
|
||||
*/
|
||||
public function testConstructor()
|
||||
{
|
||||
$this->testAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\HttpFoundation\ParameterBag::all
|
||||
*/
|
||||
public function testAll()
|
||||
{
|
||||
$bag = new ParameterBag(array('foo' => 'bar'));
|
||||
@ -54,9 +48,6 @@ class ParameterBagTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals(array('foo' => 'bar'), $bag->all());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\HttpFoundation\ParameterBag::replace
|
||||
*/
|
||||
public function testReplace()
|
||||
{
|
||||
$bag = new ParameterBag(array('foo' => 'bar'));
|
||||
@ -66,9 +57,6 @@ class ParameterBagTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertFalse($bag->has('foo'), '->replace() overrides previously set the input');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\HttpFoundation\ParameterBag::get
|
||||
*/
|
||||
public function testGet()
|
||||
{
|
||||
$bag = new ParameterBag(array('foo' => 'bar', 'null' => null));
|
||||
@ -116,9 +104,6 @@ class ParameterBagTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals('default', $bag->get('bar[moo][foo]', 'default', true));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\HttpFoundation\ParameterBag::set
|
||||
*/
|
||||
public function testSet()
|
||||
{
|
||||
$bag = new ParameterBag(array());
|
||||
@ -130,9 +115,6 @@ class ParameterBagTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals('baz', $bag->get('foo'), '->set() overrides previously set parameter');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\HttpFoundation\ParameterBag::has
|
||||
*/
|
||||
public function testHas()
|
||||
{
|
||||
$bag = new ParameterBag(array('foo' => 'bar'));
|
||||
@ -141,9 +123,6 @@ class ParameterBagTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertFalse($bag->has('unknown'), '->has() return false if a parameter is not defined');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\HttpFoundation\ParameterBag::getAlpha
|
||||
*/
|
||||
public function testGetAlpha()
|
||||
{
|
||||
$bag = new ParameterBag(array('word' => 'foo_BAR_012'));
|
||||
@ -152,9 +131,6 @@ class ParameterBagTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals('', $bag->getAlpha('unknown'), '->getAlpha() returns empty string if a parameter is not defined');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\HttpFoundation\ParameterBag::getAlnum
|
||||
*/
|
||||
public function testGetAlnum()
|
||||
{
|
||||
$bag = new ParameterBag(array('word' => 'foo_BAR_012'));
|
||||
@ -163,9 +139,6 @@ class ParameterBagTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals('', $bag->getAlnum('unknown'), '->getAlnum() returns empty string if a parameter is not defined');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\HttpFoundation\ParameterBag::getDigits
|
||||
*/
|
||||
public function testGetDigits()
|
||||
{
|
||||
$bag = new ParameterBag(array('word' => 'foo_BAR_012'));
|
||||
@ -174,9 +147,6 @@ class ParameterBagTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals('', $bag->getDigits('unknown'), '->getDigits() returns empty string if a parameter is not defined');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\HttpFoundation\ParameterBag::getInt
|
||||
*/
|
||||
public function testGetInt()
|
||||
{
|
||||
$bag = new ParameterBag(array('digits' => '0123'));
|
||||
@ -185,9 +155,6 @@ class ParameterBagTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals(0, $bag->getInt('unknown'), '->getInt() returns zero if a parameter is not defined');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\HttpFoundation\ParameterBag::filter
|
||||
*/
|
||||
public function testFilter()
|
||||
{
|
||||
$bag = new ParameterBag(array(
|
||||
@ -223,9 +190,6 @@ class ParameterBagTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals(array('bang'), $bag->filter('array', '', false), '->filter() gets a value of parameter as an array');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\HttpFoundation\ParameterBag::getIterator
|
||||
*/
|
||||
public function testGetIterator()
|
||||
{
|
||||
$parameters = array('foo' => 'bar', 'hello' => 'world');
|
||||
@ -240,9 +204,6 @@ class ParameterBagTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals(count($parameters), $i);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\HttpFoundation\ParameterBag::count
|
||||
*/
|
||||
public function testCount()
|
||||
{
|
||||
$parameters = array('foo' => 'bar', 'hello' => 'world');
|
||||
|
@ -17,17 +17,11 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
class RequestTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @covers Symfony\Component\HttpFoundation\Request::__construct
|
||||
*/
|
||||
public function testConstructor()
|
||||
{
|
||||
$this->testInitialize();
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\HttpFoundation\Request::initialize
|
||||
*/
|
||||
public function testInitialize()
|
||||
{
|
||||
$request = new Request();
|
||||
@ -94,9 +88,6 @@ class RequestTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals('pl', $locale);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\HttpFoundation\Request::create
|
||||
*/
|
||||
public function testCreate()
|
||||
{
|
||||
$request = Request::create('http://test.com/foo?bar=baz');
|
||||
@ -240,9 +231,6 @@ class RequestTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertFalse($request->isSecure());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\HttpFoundation\Request::create
|
||||
*/
|
||||
public function testCreateCheckPrecedence()
|
||||
{
|
||||
// server is used by default
|
||||
@ -311,8 +299,6 @@ class RequestTest extends \PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\HttpFoundation\Request::getFormat
|
||||
* @covers Symfony\Component\HttpFoundation\Request::setFormat
|
||||
* @dataProvider getFormatToMimeTypeMapProvider
|
||||
*/
|
||||
public function testGetFormatFromMimeType($format, $mimeTypes)
|
||||
@ -327,9 +313,6 @@ class RequestTest extends \PHPUnit_Framework_TestCase
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\HttpFoundation\Request::getFormat
|
||||
*/
|
||||
public function testGetFormatFromMimeTypeWithParameters()
|
||||
{
|
||||
$request = new Request();
|
||||
@ -337,7 +320,6 @@ class RequestTest extends \PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\HttpFoundation\Request::getMimeType
|
||||
* @dataProvider getFormatToMimeTypeMapProvider
|
||||
*/
|
||||
public function testGetMimeTypeFromFormat($format, $mimeTypes)
|
||||
@ -362,9 +344,6 @@ class RequestTest extends \PHPUnit_Framework_TestCase
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\HttpFoundation\Request::getUri
|
||||
*/
|
||||
public function testGetUri()
|
||||
{
|
||||
$server = array();
|
||||
@ -480,9 +459,6 @@ class RequestTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals('http://host:8080/ba%20se/index_dev.php/foo%20bar/in+fo?query=string', $request->getUri());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\HttpFoundation\Request::getUriForPath
|
||||
*/
|
||||
public function testGetUriForPath()
|
||||
{
|
||||
$request = Request::create('http://test.com/foo?bar=baz');
|
||||
@ -610,9 +586,6 @@ class RequestTest extends \PHPUnit_Framework_TestCase
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\HttpFoundation\Request::getUserInfo
|
||||
*/
|
||||
public function testGetUserInfo()
|
||||
{
|
||||
$request = new Request();
|
||||
@ -630,9 +603,6 @@ class RequestTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals('0:0', $request->getUserInfo());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\HttpFoundation\Request::getSchemeAndHttpHost
|
||||
*/
|
||||
public function testGetSchemeAndHttpHost()
|
||||
{
|
||||
$request = new Request();
|
||||
@ -657,8 +627,6 @@ class RequestTest extends \PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\HttpFoundation\Request::getQueryString
|
||||
* @covers Symfony\Component\HttpFoundation\Request::normalizeQueryString
|
||||
* @dataProvider getQueryStringNormalizationData
|
||||
*/
|
||||
public function testGetQueryString($query, $expectedQuery, $msg)
|
||||
@ -794,10 +762,6 @@ class RequestTest extends \PHPUnit_Framework_TestCase
|
||||
$request->getHost();
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\HttpFoundation\Request::setMethod
|
||||
* @covers Symfony\Component\HttpFoundation\Request::getMethod
|
||||
*/
|
||||
public function testGetSetMethod()
|
||||
{
|
||||
$request = new Request();
|
||||
|
@ -20,7 +20,6 @@ use Symfony\Component\HttpFoundation\Cookie;
|
||||
class ResponseHeaderBagTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @covers Symfony\Component\HttpFoundation\ResponseHeaderBag::allPreserveCase
|
||||
* @dataProvider provideAllPreserveCase
|
||||
*/
|
||||
public function testAllPreserveCase($headers, $expected)
|
||||
|
@ -169,9 +169,6 @@ class AttributeBagTest extends \PHPUnit_Framework_TestCase
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag::getIterator
|
||||
*/
|
||||
public function testGetIterator()
|
||||
{
|
||||
$i = 0;
|
||||
@ -183,9 +180,6 @@ class AttributeBagTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals(count($this->array), $i);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag::count
|
||||
*/
|
||||
public function testCount()
|
||||
{
|
||||
$this->assertEquals(count($this->array), count($this->bag));
|
||||
|
@ -133,7 +133,6 @@ class FlashBagTest extends \PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\HttpFoundation\Session\Flash\FlashBag::getIterator
|
||||
* @group legacy
|
||||
*/
|
||||
public function testLegacyGetIterator()
|
||||
|
@ -190,9 +190,6 @@ class SessionTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertInstanceOf('Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface', $this->session->getFlashBag());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\HttpFoundation\Session\Session::getIterator
|
||||
*/
|
||||
public function testGetIterator()
|
||||
{
|
||||
$attributes = array('hello' => 'world', 'symfony' => 'rocks');
|
||||
@ -209,9 +206,6 @@ class SessionTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals(count($attributes), $i);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Symfony\Component\HttpFoundation\Session\Session::count
|
||||
*/
|
||||
public function testGetCount()
|
||||
{
|
||||
$this->session->set('hello', 'world');
|
||||
|
@ -29,8 +29,6 @@ abstract class AbstractIntlDateFormatterTest extends \PHPUnit_Framework_TestCase
|
||||
/**
|
||||
* When a time zone is not specified, it uses the system default however it returns null in the getter method.
|
||||
*
|
||||
* @covers Symfony\Component\Intl\DateFormatter\IntlDateFormatter::getTimeZoneId
|
||||
*
|
||||
* @see StubIntlDateFormatterTest::testDefaultTimeZoneIntl()
|
||||
*/
|
||||
public function testConstructorDefaultTimeZone()
|
||||
@ -867,7 +865,6 @@ abstract class AbstractIntlDateFormatterTest extends \PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\Intl\DateFormatter\IntlDateFormatter::getTimeZoneId
|
||||
* @dataProvider setTimeZoneIdProvider
|
||||
*/
|
||||
public function testSetTimeZoneId($timeZoneId, $expectedTimeZoneId)
|
||||
|
@ -85,10 +85,6 @@ class AbstractTokenTest extends \PHPUnit_Framework_TestCase
|
||||
$token->eraseCredentials();
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\Security\Core\Authentication\Token\AbstractToken::serialize
|
||||
* @covers Symfony\Component\Security\Core\Authentication\Token\AbstractToken::unserialize
|
||||
*/
|
||||
public function testSerialize()
|
||||
{
|
||||
$token = $this->getToken(array('ROLE_FOO'));
|
||||
@ -114,9 +110,6 @@ class AbstractTokenTest extends \PHPUnit_Framework_TestCase
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\Security\Core\Authentication\Token\AbstractToken::__construct
|
||||
*/
|
||||
public function testConstructor()
|
||||
{
|
||||
$token = $this->getToken(array('ROLE_FOO'));
|
||||
@ -129,10 +122,6 @@ class AbstractTokenTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals(array(new Role('ROLE_FOO'), new Role('ROLE_BAR')), $token->getRoles());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\Security\Core\Authentication\Token\AbstractToken::isAuthenticated
|
||||
* @covers Symfony\Component\Security\Core\Authentication\Token\AbstractToken::setAuthenticated
|
||||
*/
|
||||
public function testAuthenticatedFlag()
|
||||
{
|
||||
$token = $this->getToken();
|
||||
@ -145,13 +134,6 @@ class AbstractTokenTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertFalse($token->isAuthenticated());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\Security\Core\Authentication\Token\AbstractToken::getAttributes
|
||||
* @covers Symfony\Component\Security\Core\Authentication\Token\AbstractToken::setAttributes
|
||||
* @covers Symfony\Component\Security\Core\Authentication\Token\AbstractToken::hasAttribute
|
||||
* @covers Symfony\Component\Security\Core\Authentication\Token\AbstractToken::getAttribute
|
||||
* @covers Symfony\Component\Security\Core\Authentication\Token\AbstractToken::setAttribute
|
||||
*/
|
||||
public function testAttributes()
|
||||
{
|
||||
$attributes = array('foo' => 'bar');
|
||||
|
@ -16,7 +16,6 @@ use Symfony\Component\Security\Core\User\User;
|
||||
class UserTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @covers Symfony\Component\Security\Core\User\User::__construct
|
||||
* @expectedException \InvalidArgumentException
|
||||
*/
|
||||
public function testConstructorException()
|
||||
@ -24,10 +23,6 @@ class UserTest extends \PHPUnit_Framework_TestCase
|
||||
new User('', 'superpass');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\Security\Core\User\User::__construct
|
||||
* @covers Symfony\Component\Security\Core\User\User::getRoles
|
||||
*/
|
||||
public function testGetRoles()
|
||||
{
|
||||
$user = new User('fabien', 'superpass');
|
||||
@ -37,38 +32,24 @@ class UserTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals(array('ROLE_ADMIN'), $user->getRoles());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\Security\Core\User\User::__construct
|
||||
* @covers Symfony\Component\Security\Core\User\User::getPassword
|
||||
*/
|
||||
public function testGetPassword()
|
||||
{
|
||||
$user = new User('fabien', 'superpass');
|
||||
$this->assertEquals('superpass', $user->getPassword());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\Security\Core\User\User::__construct
|
||||
* @covers Symfony\Component\Security\Core\User\User::getUsername
|
||||
*/
|
||||
public function testGetUsername()
|
||||
{
|
||||
$user = new User('fabien', 'superpass');
|
||||
$this->assertEquals('fabien', $user->getUsername());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\Security\Core\User\User::getSalt
|
||||
*/
|
||||
public function testGetSalt()
|
||||
{
|
||||
$user = new User('fabien', 'superpass');
|
||||
$this->assertEquals('', $user->getSalt());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\Security\Core\User\User::isAccountNonExpired
|
||||
*/
|
||||
public function testIsAccountNonExpired()
|
||||
{
|
||||
$user = new User('fabien', 'superpass');
|
||||
@ -78,9 +59,6 @@ class UserTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertFalse($user->isAccountNonExpired());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\Security\Core\User\User::isCredentialsNonExpired
|
||||
*/
|
||||
public function testIsCredentialsNonExpired()
|
||||
{
|
||||
$user = new User('fabien', 'superpass');
|
||||
@ -90,9 +68,6 @@ class UserTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertFalse($user->isCredentialsNonExpired());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\Security\Core\User\User::isAccountNonLocked
|
||||
*/
|
||||
public function testIsAccountNonLocked()
|
||||
{
|
||||
$user = new User('fabien', 'superpass');
|
||||
@ -102,9 +77,6 @@ class UserTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertFalse($user->isAccountNonLocked());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\Security\Core\User\User::isEnabled
|
||||
*/
|
||||
public function testIsEnabled()
|
||||
{
|
||||
$user = new User('fabien', 'superpass');
|
||||
@ -114,9 +86,6 @@ class UserTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertFalse($user->isEnabled());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\Security\Core\User\User::eraseCredentials
|
||||
*/
|
||||
public function testEraseCredentials()
|
||||
{
|
||||
$user = new User('fabien', 'superpass');
|
||||
|
Reference in New Issue
Block a user