8000 Fix Container and PhpDumper test inaccuracies by nikita2206 · Pull Request #21226 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Fix Container and PhpDumper test inaccuracies #21226

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public function testSet()
{
$sc = new Container();
$sc->set('foo', $foo = new \stdClass());
$this->assertEquals($foo, $sc->get('foo'), '->set() sets a service');
$this->assertSame($foo, $sc->get('foo'), '->set() sets a service');
}

public function testSetWithNullResetTheService()
Expand Down Expand Up @@ -196,15 +196,15 @@ public function testGet()
{
$sc = new ProjectServiceContainer();
$sc->set('foo', $foo = new \stdClass());
$this->assertEquals($foo, $sc->get('foo'), '->get() returns the service for the given id');
$this->assertEquals($foo, $sc->get('Foo'), '->get() returns the service for the given id, and converts id to lowercase');
$this->assertEquals($sc->__bar, $sc->get('bar'), '->get() returns the service for the given id');
$this->assertEquals($sc->__foo_bar, $sc->get('foo_bar'), '->get() returns the service if a get*Method() is defined');
$this->assertEquals($sc->__foo_baz, $sc->get('foo.baz'), '->get() returns the service if a get*Method() is defined');
$this->assertEquals($sc->__foo_baz, $sc->get('foo\\baz'), '->get() returns the service if a get*Method() is defined');
$this->assertSame($foo, $sc->get('foo'), '->get() returns the service for the given id');
$this->assertSame($foo, $sc->get('Foo'), '->get() returns the service for the given id, and converts id to lowercase');
$this->assertSame($sc->__bar, $sc->get('bar'), '->get() returns the service for the given id');
$this->assertSame($sc->__foo_bar, $sc->get('foo_bar'), '->get() returns the service if a get*Method() is defined');
$this->assertSame($sc->__foo_baz, $sc->get('foo.baz'), '->get() returns the service if a get*Method() is defined');
$this->asser AF2E tSame($sc->__foo_baz, $sc->get('foo\\baz'), '->get() returns the service if a get*Method() is defined');

$sc->set('bar', $bar = new \stdClass());
$this->assertEquals($bar, $sc->get('bar'), '->get() prefers to return a service defined with set() than one defined with a getXXXMethod()');
$this->assertSame($bar, $sc->get('bar'), '->get() prefers to return a service defined with set() than one defined with a getXXXMethod()');

try {
$sc->get('');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ public function testOverrideServiceWhenUsingADumpedContainer()
$container->set('bar', $bar = new \stdClass());
$container->setParameter('foo_bar', 'foo_bar');

$this->assertEquals($bar, $container->get('bar'), '->set() overrides an already defined service');
$this->assertSame($bar, $container->get('bar'), '->set() overrides an already defined service');
}

public function testOverrideServiceWhenUsingADumpedContainerAndServiceIsUsedFromAnotherOne()
Expand Down
0