Skip to content

Commit 1b3ff6f

Browse files
committed
Fix Container and PhpDumper test inaccuracies
1 parent 6dd4a0a commit 1b3ff6f

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

Tests/ContainerTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public function testSet()
134134
{
135135
$sc = new Container();
136136
$sc->set('foo', $foo = new \stdClass());
137-
$this->assertEquals($foo, $sc->get('foo'), '->set() sets a service');
137+
$this->assertSame($foo, $sc->get('foo'), '->set() sets a service');
138138
}
139139

140140
public function testSetWithNullResetTheService()
@@ -196,15 +196,15 @@ public function testGet()
196196
{
197197
$sc = new ProjectServiceContainer();
198198
$sc->set('foo', $foo = new \stdClass());
199-
$this->assertEquals($foo, $sc->get('foo'), '->get() returns the service for the given id');
200-
$this->assertEquals($foo, $sc->get('Foo'), '->get() returns the service for the given id, and converts id to lowercase');
201-
$this->assertEquals($sc->__bar, $sc->get('bar'), '->get() returns the service for the given id');
202-
$this->assertEquals($sc->__foo_bar, $sc->get('foo_bar'), '->get() returns the service if a get*Method() is defined');
203-
$this->assertEquals($sc->__foo_baz, $sc->get('foo.baz'), '->get() returns the service if a get*Method() is defined');
204-
$this->assertEquals($sc->__foo_baz, $sc->get('foo\\baz'), '->get() returns the service if a get*Method() is defined');
199+
$this->assertSame($foo, $sc->get('foo'), '->get() returns the service for the given id');
200+
$this->assertSame($foo, $sc->get('Foo'), '->get() returns the service for the given id, and converts id to lowercase');
201+
$this->assertSame($sc->__bar, $sc->get('bar'), '->get() returns the service for the given id');
202+
$this->assertSame($sc->__foo_bar, $sc->get('foo_bar'), '->get() returns the service if a get*Method() is defined');
203+
$this->assertSame($sc->__foo_baz, $sc->get('foo.baz'), '->get() returns the service if a get*Method() is defined');
204+
$this->assertSame($sc->__foo_baz, $sc->get('foo\\baz'), '->get() returns the service if a get*Method() is defined');
205205

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

209209
try {
210210
$sc->get('');

Tests/Dumper/PhpDumperTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ public function testOverrideServiceWhenUsingADumpedContainer()
230230
$container->set('bar', $bar = new \stdClass());
231231
$container->setParameter('foo_bar', 'foo_bar');
232232

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

236236
public function testOverrideServiceWhenUsingADumpedContainerAndServiceIsUsedFromAnotherOne()

0 commit comments

Comments
 (0)