This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/tests/Symfony/Tests/Component/DependencyInjection/ReferenceTest.php
Christophe Coevoet 2c3e9adcd1 [DependencyInjection] Made the reference case insensitive
The container is case insensitive so using capital letters in a reference
made it fail in some cases when checking the dependencies.
Closes #2807
2011-12-08 16:30:50 +01:00

33 lines
937 B
PHP

<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Tests\Component\DependencyInjection;
use Symfony\Component\DependencyInjection\Reference;
class ReferenceTest extends \PHPUnit_Framework_TestCase
{
/**
* @covers Symfony\Component\DependencyInjection\Reference::__construct
*/
public function testConstructor()
{
$ref = new Reference('foo');
$this->assertEquals('foo', (string) $ref, '__construct() sets the id of the reference, which is used for the __toString() method');
}
public function testCaseInsensitive()
{
$ref = new Reference('FooBar');
$this->assertEquals('foobar', (string) $ref, 'the id is lowercased as the container is case insensitive');
}
}