Skip to content

Commit 10b588d

Browse files
Merge branch '3.4' into 4.3
* 3.4: Fix tests Fix deprecated phpunit annotation
1 parent f45f5f7 commit 10b588d

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

Service/Test/ServiceLocatorTest.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,25 +64,23 @@ public function testGetDoesNotMemoize()
6464
$this->assertSame(2, $i);
6565
}
6666

67-
/**
68-
* @expectedException \Psr\Container\NotFoundExceptionInterface
69-
* @expectedExceptionMessage The service "foo" has a dependency on a non-existent service "bar". This locator only knows about the "foo" service.
70-
*/
7167
public function testThrowsOnUndefinedInternalService()
7268
{
69+
if (!$this->getExpectedException()) {
70+
$this->expectException('Psr\Container\NotFoundExceptionInterface');
71+
$this->expectExceptionMessage('The service "foo" has a dependency on a non-existent service "bar". This locator only knows about the "foo" service.');
72+
}
7373
$locator = $this->getServiceLocator([
7474
'foo' => function () use (&$locator) { return $locator->get('bar'); },
7575
]);
7676

7777
$locator->get('foo');
7878
}
7979

80-
/**
81-
* @expectedException \Psr\Container\ContainerExceptionInterface
82-
* @expectedExceptionMessage Circular reference detected for service "bar", path: "bar -> baz -> bar".
83-
*/
8480
public function testThrowsOnCircularReference()
8581
{
82+
$this->expectException('Psr\Container\ContainerExceptionInterface');
83+
$this->expectExceptionMessage('Circular reference detected for service "bar", path: "bar -> baz -> bar".');
8684
$locator = $this->getServiceLocator([
8785
'foo' => function () use (&$locator) { return $locator->get('bar'); },
8886
'bar' => function () use (&$locator) { return $locator->get('baz'); },

Translation/Test/TranslatorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,10 @@ public function testReturnMessageIfExactlyOneStandardRuleIsGiven()
158158

159159
/**
160160
* @dataProvider getNonMatchingMessages
161-
* @expectedException \InvalidArgumentException
162161
*/
163162
public function testThrowExceptionIfMatchingMessageCannotBeFound($id, $number)
164163
{
164+
$this->expectException('InvalidArgumentException');
165165
$translator = $this->getTranslator();
166166

167167
$translator->trans($id, ['%count%' => $number]);

0 commit comments

Comments
 (0)