Merge branch '2.8'
* 2.8: removed @covers annotations in tests removed @covers annotations in tests removed all @covers annotations checkCredentials() force it to be an affirmative yes! [PropertyAccess] Major performance improvement
This commit is contained in:
commit
04eda701cc
@ -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
|
||||
{
|
||||
|
@ -16,9 +16,6 @@ use Symfony\Component\Console\Application;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Tester\CommandTester;
|
||||
|
||||
/**
|
||||
* @covers \Symfony\Bridge\Twig\Command\LintCommand
|
||||
*/
|
||||
class LintCommandTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
private $files;
|
||||
|
@ -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');
|
||||
@ -83,9 +71,6 @@ class HelperSetTest extends \PHPUnit_Framework_TestCase
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Symfony\Component\Console\Helper\HelperSet::setCommand
|
||||
*/
|
||||
public function testSetCommand()
|
||||
{
|
||||
$cmd_01 = new Command('foo');
|
||||
@ -101,9 +86,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');
|
||||
@ -112,9 +94,6 @@ class HelperSetTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals($cmd, $helperset->getCommand(), '->getCommand() retrieves stored command');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Symfony\Component\Console\Helper\HelperSet::getIterator
|
||||
*/
|
||||
public function testIteration()
|
||||
{
|
||||
$helperset = new HelperSet();
|
||||
|
@ -28,12 +28,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();
|
||||
@ -84,9 +78,6 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertTrue($wasTriggered);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::register
|
||||
*/
|
||||
public function testRegister()
|
||||
{
|
||||
$builder = new ContainerBuilder();
|
||||
@ -95,9 +86,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();
|
||||
@ -108,9 +96,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();
|
||||
@ -141,10 +126,6 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertTrue($builder->get('bar') === $builder->get('bar'), '->get() always returns the same instance if the service is shared');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::get
|
||||
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::setShared
|
||||
*/
|
||||
public function testNonSharedServicesReturnsDifferentInstances()
|
||||
{
|
||||
$builder = new ContainerBuilder();
|
||||
@ -154,7 +135,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.
|
||||
*/
|
||||
@ -173,9 +153,6 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
$builder->get('foo');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::getServiceIds
|
||||
*/
|
||||
public function testGetServiceIds()
|
||||
{
|
||||
$builder = new ContainerBuilder();
|
||||
@ -185,11 +162,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();
|
||||
@ -216,9 +188,6 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::getAliases
|
||||
*/
|
||||
public function testGetAliases()
|
||||
{
|
||||
$builder = new ContainerBuilder();
|
||||
@ -241,9 +210,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();
|
||||
@ -254,9 +220,6 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertTrue(isset($aliases['foobar']));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::addAliases
|
||||
*/
|
||||
public function testAddAliases()
|
||||
{
|
||||
$builder = new ContainerBuilder();
|
||||
@ -268,10 +231,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();
|
||||
@ -282,9 +241,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();
|
||||
@ -295,9 +251,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();
|
||||
@ -311,9 +264,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();
|
||||
@ -322,9 +272,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();
|
||||
@ -334,9 +281,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();
|
||||
@ -351,9 +295,6 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertTrue($builder->get('baz')->called, '->createService() uses another service as factory');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::createService
|
||||
*/
|
||||
public function testCreateServiceMethodCalls()
|
||||
{
|
||||
$builder = new ContainerBuilder();
|
||||
@ -363,9 +304,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();
|
||||
@ -393,7 +331,6 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::createService
|
||||
* @expectedException \RuntimeException
|
||||
*/
|
||||
public function testCreateSyntheticService()
|
||||
@ -412,9 +349,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();
|
||||
@ -424,9 +358,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')));
|
||||
@ -472,7 +403,6 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::merge
|
||||
* @expectedException \LogicException
|
||||
*/
|
||||
public function testMergeLogicException()
|
||||
@ -483,9 +413,6 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
$container->merge(new ContainerBuilder());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::findTaggedServiceIds
|
||||
*/
|
||||
public function testfindTaggedServiceIds()
|
||||
{
|
||||
$builder = new ContainerBuilder();
|
||||
@ -516,9 +443,6 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals(array('kenrel.event_listener'), $builder->findUnusedTags(), '->findUnusedTags() returns an array with unused tags');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::findDefinition
|
||||
*/
|
||||
public function testFindDefinition()
|
||||
{
|
||||
$container = new ContainerBuilder();
|
||||
@ -528,9 +452,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();
|
||||
@ -554,9 +475,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();
|
||||
@ -580,9 +498,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();
|
||||
@ -605,10 +520,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();
|
||||
@ -625,10 +536,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();
|
||||
@ -728,10 +635,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();
|
||||
|
@ -17,9 +17,6 @@ use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
|
||||
|
||||
class ContainerTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\Container::__construct
|
||||
*/
|
||||
public function testConstructor()
|
||||
{
|
||||
$sc = new Container();
|
||||
@ -73,9 +70,6 @@ class ContainerTest extends \PHPUnit_Framework_TestCase
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\Container::compile
|
||||
*/
|
||||
public function testCompile()
|
||||
{
|
||||
$sc = new Container(new ParameterBag(array('foo' => 'bar')));
|
||||
@ -86,9 +80,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')));
|
||||
@ -97,19 +88,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')));
|
||||
@ -132,9 +116,6 @@ class ContainerTest extends \PHPUnit_Framework_TestCase
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\Container::getServiceIds
|
||||
*/
|
||||
public function testGetServiceIds()
|
||||
{
|
||||
$sc = new Container();
|
||||
@ -147,9 +128,6 @@ class ContainerTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals(array('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();
|
||||
@ -157,9 +135,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();
|
||||
@ -167,9 +142,6 @@ class ContainerTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertFalse($sc->has('foo'), '->set() with null service resets the service');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\Container::get
|
||||
*/
|
||||
public function testGet()
|
||||
{
|
||||
$sc = new ProjectServiceContainer();
|
||||
@ -229,9 +201,6 @@ class ContainerTest extends \PHPUnit_Framework_TestCase
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\Container::has
|
||||
*/
|
||||
public function testHas()
|
||||
{
|
||||
$sc = new ProjectServiceContainer();
|
||||
@ -244,9 +213,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();
|
||||
|
@ -16,9 +16,6 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
|
||||
class DefinitionTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\Definition::__construct
|
||||
*/
|
||||
public function testConstructor()
|
||||
{
|
||||
$def = new Definition('stdClass');
|
||||
@ -28,10 +25,6 @@ class DefinitionTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals(array('foo'), $def->getArguments(), '__construct() takes an optional array of arguments as its second argument');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\Definition::setFactory
|
||||
* @covers Symfony\Component\DependencyInjection\Definition::getFactory
|
||||
*/
|
||||
public function testSetGetFactory()
|
||||
{
|
||||
$def = new Definition('stdClass');
|
||||
@ -43,10 +36,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');
|
||||
@ -81,11 +70,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');
|
||||
@ -95,12 +79,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');
|
||||
@ -124,10 +102,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');
|
||||
@ -135,10 +109,6 @@ class DefinitionTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals('foo', $def->getFile(), '->getFile() returns the file to include');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\Definition::setShared
|
||||
* @covers Symfony\Component\DependencyInjection\Definition::isShared
|
||||
*/
|
||||
public function testSetIsShared()
|
||||
{
|
||||
$def = new Definition('stdClass');
|
||||
@ -147,10 +117,6 @@ class DefinitionTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertFalse($def->isShared(), '->isShared() returns false if the instance must not be shared');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\Definition::setPublic
|
||||
* @covers Symfony\Component\DependencyInjection\Definition::isPublic
|
||||
*/
|
||||
public function testSetIsPublic()
|
||||
{
|
||||
$def = new Definition('stdClass');
|
||||
@ -159,10 +125,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');
|
||||
@ -171,10 +133,6 @@ class DefinitionTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertTrue($def->isSynthetic(), '->isSynthetic() returns true if the service is synthetic.');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\Definition::setLazy
|
||||
* @covers Symfony\Component\DependencyInjection\Definition::isLazy
|
||||
*/
|
||||
public function testSetIsLazy()
|
||||
{
|
||||
$def = new Definition('stdClass');
|
||||
@ -183,10 +141,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');
|
||||
@ -195,12 +149,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::setDeprecated
|
||||
* @covers Symfony\Component\DependencyInjection\Definition::isDeprecated
|
||||
* @covers Symfony\Component\DependencyInjection\Definition::hasCustomDeprecationTemplate
|
||||
* @covers Symfony\Component\DependencyInjection\Definition::getDeprecationMessage
|
||||
*/
|
||||
public function testSetIsDeprecated()
|
||||
{
|
||||
$def = new Definition('stdClass');
|
||||
@ -212,7 +160,6 @@ class DefinitionTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* @dataProvider invalidDeprecationMessageProvider
|
||||
* @covers Symfony\Component\DependencyInjection\Definition::setDeprecated
|
||||
* @expectedException Symfony\Component\DependencyInjection\Exception\InvalidArgumentException
|
||||
*/
|
||||
public function testSetDeprecatedWithInvalidDeprecationTemplate($message)
|
||||
@ -231,10 +178,6 @@ class DefinitionTest extends \PHPUnit_Framework_TestCase
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\Definition::setConfigurator
|
||||
* @covers Symfony\Component\DependencyInjection\Definition::getConfigurator
|
||||
*/
|
||||
public function testSetGetConfigurator()
|
||||
{
|
||||
$def = new Definition('stdClass');
|
||||
@ -242,9 +185,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');
|
||||
@ -254,9 +194,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');
|
||||
@ -273,12 +210,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');
|
||||
@ -296,9 +227,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());
|
||||
|
@ -369,9 +369,6 @@ class XmlFileLoaderTest extends \PHPUnit_Framework_TestCase
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DependencyInjection\Loader\XmlFileLoader::supports
|
||||
*/
|
||||
public function testSupports()
|
||||
{
|
||||
$loader = new XmlFileLoader(new ContainerBuilder(), new FileLocator());
|
||||
|
@ -190,9 +190,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');
|
||||
|
@ -27,9 +27,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();
|
||||
@ -86,9 +83,6 @@ class CrawlerTest extends \PHPUnit_Framework_TestCase
|
||||
$crawler->addHtmlContent('<html><div class="foo"></html>', 'UTF-8');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DomCrawler\Crawler::addHtmlContent
|
||||
*/
|
||||
public function testAddHtmlContent()
|
||||
{
|
||||
$crawler = new Crawler();
|
||||
@ -97,9 +91,6 @@ class CrawlerTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals('foo', $crawler->filterXPath('//div')->attr('class'), '->addHtmlContent() adds nodes from an HTML string');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DomCrawler\Crawler::addHtmlContent
|
||||
*/
|
||||
public function testAddHtmlContentWithBaseTag()
|
||||
{
|
||||
$crawler = new Crawler();
|
||||
@ -111,7 +102,7 @@ class CrawlerTest extends \PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DomCrawler\Crawler::addHtmlContent
|
||||
* @requires extension mbstring
|
||||
*/
|
||||
public function testAddHtmlContentCharset()
|
||||
{
|
||||
@ -121,9 +112,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');
|
||||
@ -133,9 +121,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();
|
||||
@ -145,7 +130,7 @@ class CrawlerTest extends \PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DomCrawler\Crawler::addHtmlContent
|
||||
* @requires extension mbstring
|
||||
*/
|
||||
public function testAddHtmlContentCharsetGbk()
|
||||
{
|
||||
@ -156,9 +141,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);
|
||||
@ -184,9 +166,6 @@ EOF
|
||||
libxml_use_internal_errors($internalErrors);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DomCrawler\Crawler::addXmlContent
|
||||
*/
|
||||
public function testAddXmlContent()
|
||||
{
|
||||
$crawler = new Crawler();
|
||||
@ -195,9 +174,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();
|
||||
@ -206,9 +182,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);
|
||||
@ -232,9 +205,6 @@ EOF
|
||||
libxml_use_internal_errors($internalErrors);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DomCrawler\Crawler::addContent
|
||||
*/
|
||||
public function testAddContent()
|
||||
{
|
||||
$crawler = new Crawler();
|
||||
@ -270,9 +240,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();
|
||||
@ -281,9 +248,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();
|
||||
@ -292,9 +256,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()
|
||||
{
|
||||
$list = array();
|
||||
@ -308,9 +269,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();
|
||||
@ -470,9 +428,6 @@ EOF
|
||||
$this->assertCount(7, $crawler->filterXPath('( ( //a | //div )//img | //ul )'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DomCrawler\Crawler::filterXPath
|
||||
*/
|
||||
public function testFilterXPath()
|
||||
{
|
||||
$crawler = $this->createTestCrawler();
|
||||
@ -640,9 +595,6 @@ EOF
|
||||
$this->assertCount(9, $crawler->filterXPath('self::*/a'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\DomCrawler\Crawler::filter
|
||||
*/
|
||||
public function testFilter()
|
||||
{
|
||||
$crawler = $this->createTestCrawler();
|
||||
|
@ -13,9 +13,6 @@ namespace Symfony\Component\Form\Tests\Extension\DataCollector;
|
||||
|
||||
use Symfony\Component\Form\Extension\DataCollector\DataCollectorExtension;
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\Form\Extension\DataCollector\DataCollectorExtension
|
||||
*/
|
||||
class DataCollectorExtensionTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
|
@ -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));
|
||||
@ -85,9 +73,6 @@ class ParameterBagTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertNull($bag->get('foo[bar]'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\HttpFoundation\ParameterBag::set
|
||||
*/
|
||||
public function testSet()
|
||||
{
|
||||
$bag = new ParameterBag(array());
|
||||
@ -99,9 +84,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'));
|
||||
@ -110,9 +92,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'));
|
||||
@ -121,9 +100,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'));
|
||||
@ -132,9 +108,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'));
|
||||
@ -143,9 +116,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'));
|
||||
@ -154,9 +124,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(
|
||||
@ -192,9 +159,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');
|
||||
@ -209,9 +173,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');
|
||||
@ -220,9 +181,6 @@ class ParameterBagTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals(count($parameters), count($bag));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\HttpFoundation\ParameterBag::getBoolean
|
||||
*/
|
||||
public function testGetBoolean()
|
||||
{
|
||||
$parameters = array('string_true' => 'true', 'string_false' => 'false');
|
||||
|
@ -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));
|
||||
|
@ -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()
|
||||
@ -796,7 +794,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');
|
||||
@ -124,9 +93,6 @@ class UserTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals('superpass', $user->getPassword());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Symfony\Component\Security\Core\User\User::__toString
|
||||
*/
|
||||
public function testToString()
|
||||
{
|
||||
$user = new User('fabien', 'superpass');
|
||||
|
@ -73,7 +73,11 @@ interface GuardAuthenticatorInterface extends AuthenticationEntryPointInterface
|
||||
public function getUser($credentials, UserProviderInterface $userProvider);
|
||||
|
||||
/**
|
||||
* Throw an AuthenticationException if the credentials are invalid.
|
||||
* Returns true if the credentials are valid.
|
||||
*
|
||||
* If any value other than true is returned, authentication will
|
||||
* fail. You may also throw an AuthenticationException if you wish
|
||||
* to cause authentication to fail.
|
||||
*
|
||||
* The *credentials* are the return value from getCredentials()
|
||||
*
|
||||
|
@ -13,6 +13,7 @@ namespace Symfony\Component\Security\Guard\Provider;
|
||||
|
||||
use Symfony\Component\Security\Core\Authentication\Provider\AuthenticationProviderInterface;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\AnonymousToken;
|
||||
use Symfony\Component\Security\Core\Exception\BadCredentialsException;
|
||||
use Symfony\Component\Security\Core\Exception\UsernameNotFoundException;
|
||||
use Symfony\Component\Security\Guard\GuardAuthenticatorInterface;
|
||||
use Symfony\Component\Security\Guard\Token\GuardTokenInterface;
|
||||
@ -122,7 +123,9 @@ class GuardAuthenticationProvider implements AuthenticationProviderInterface
|
||||
}
|
||||
|
||||
$this->userChecker->checkPreAuth($user);
|
||||
$guardAuthenticator->checkCredentials($token->getCredentials(), $user);
|
||||
if (true !== $guardAuthenticator->checkCredentials($token->getCredentials(), $user)) {
|
||||
throw new BadCredentialsException(sprintf('Authentication failed because %s::checkCredentials() did not return true.', get_class($guardAuthenticator)));
|
||||
}
|
||||
$this->userChecker->checkPostAuth($user);
|
||||
|
||||
// turn the UserInterface into a TokenInterface
|
||||
|
@ -60,7 +60,9 @@ class GuardAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
|
||||
// checkCredentials is called
|
||||
$authenticatorB->expects($this->once())
|
||||
->method('checkCredentials')
|
||||
->with($enteredCredentials, $mockedUser);
|
||||
->with($enteredCredentials, $mockedUser)
|
||||
// authentication works!
|
||||
->will($this->returnValue(true));
|
||||
$authedToken = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface');
|
||||
$authenticatorB->expects($this->once())
|
||||
->method('createAuthenticatedToken')
|
||||
@ -80,6 +82,39 @@ class GuardAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertSame($authedToken, $actualAuthedToken);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Symfony\Component\Security\Core\Exception\BadCredentialsException
|
||||
*/
|
||||
public function testCheckCredentialsReturningNonTrueFailsAuthentication()
|
||||
{
|
||||
$providerKey = 'my_uncool_firewall';
|
||||
|
||||
$authenticator = $this->getMock('Symfony\Component\Security\Guard\GuardAuthenticatorInterface');
|
||||
|
||||
// make sure the authenticator is used
|
||||
$this->preAuthenticationToken->expects($this->any())
|
||||
->method('getGuardProviderKey')
|
||||
// the 0 index, to match the only authenticator
|
||||
->will($this->returnValue('my_uncool_firewall_0'));
|
||||
|
||||
$this->preAuthenticationToken->expects($this->atLeastOnce())
|
||||
->method('getCredentials')
|
||||
->will($this->returnValue('non-null-value'));
|
||||
|
||||
$mockedUser = $this->getMock('Symfony\Component\Security\Core\User\UserInterface');
|
||||
$authenticator->expects($this->once())
|
||||
->method('getUser')
|
||||
->will($this->returnValue($mockedUser));
|
||||
// checkCredentials is called
|
||||
$authenticator->expects($this->once())
|
||||
->method('checkCredentials')
|
||||
// authentication fails :(
|
||||
->will($this->returnValue(null));
|
||||
|
||||
$provider = new GuardAuthenticationProvider(array($authenticator), $this->userProvider, $providerKey, $this->userChecker);
|
||||
$provider->authenticate($this->preAuthenticationToken);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Symfony\Component\Security\Core\Exception\AuthenticationExpiredException
|
||||
*/
|
||||
|
@ -572,8 +572,6 @@ EOF
|
||||
*
|
||||
* @see http://yaml.org/spec/1.2/spec.html#id2759572
|
||||
* @see http://yaml.org/spec/1.1/#id932806
|
||||
*
|
||||
* @covers \Symfony\Component\Yaml\Parser::parse
|
||||
*/
|
||||
public function testMappingDuplicateKeyBlock()
|
||||
{
|
||||
@ -593,9 +591,6 @@ EOD;
|
||||
$this->assertSame($expected, Yaml::parse($input));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Symfony\Component\Yaml\Inline::parseMapping
|
||||
*/
|
||||
public function testMappingDuplicateKeyFlow()
|
||||
{
|
||||
$input = <<<EOD
|
||||
|
Reference in New Issue
Block a user