Skip to content
This repository was archived by the owner on Feb 6, 2020. It is now read-only.

Commit 0594d92

Browse files
committed
#241 corrected CS in newly introduced tests, removed equalsTo for strings
1 parent af51b39 commit 0594d92

File tree

1 file changed

+15
-18
lines changed

1 file changed

+15
-18
lines changed

test/ServiceManagerTest.php

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,9 @@
88
namespace ZendTest\ServiceManager;
99

1010
use DateTime;
11-
use Interop\Container\Exception\ContainerException;
1211
use PHPUnit\Framework\TestCase;
1312
use Psr\Container\ContainerInterface;
1413
use stdClass;
15-
use Zend\ServiceManager\Exception\ServiceNotCreatedException;
16-
use Zend\ServiceManager\Exception\ServiceNotFoundException;
1714
use Zend\ServiceManager\Factory\AbstractFactoryInterface;
1815
use Zend\ServiceManager\Factory\FactoryInterface;
1916
use Zend\ServiceManager\Factory\InvokableFactory;
@@ -318,7 +315,7 @@ public function testResolvedAliasFromAbstractFactory()
318315
$abstractFactory = $this->createMock(AbstractFactoryInterface::class);
319316

320317
$serviceManager = new SimpleServiceManager([
321-
'aliases' => [
318+
'aliases' => [
322319
'Alias' => 'ServiceName',
323320
],
324321
'abstract_factories' => [
@@ -327,26 +324,25 @@ public function testResolvedAliasFromAbstractFactory()
327324
]);
328325

329326
$abstractFactory
330-
->expects($this->any())
327+
->expects(self::any())
331328
->method('canCreate')
332329
->withConsecutive(
333-
[ $this->anything(), $this->equalTo('Alias') ],
334-
[ $this->anything(), $this->equalTo('ServiceName')]
330+
[self::anything(), 'Alias'],
331+
[self::anything(), 'ServiceName']
335332
)
336-
->will(self::returnCallback(
337-
function ($context, $name) {
338-
return $name === 'ServiceName';
339-
}
340-
));
341-
$this->assertTrue($serviceManager->has('Alias'));
333+
->will(self::returnCallback(function ($context, $name) {
334+
return $name === 'ServiceName';
335+
}));
336+
337+
self::assertTrue($serviceManager->has('Alias'));
342338
}
343339

344340
public function testResolvedAliasNoMatchingAbstractFactoryReturnsFalse()
345341
{
346342
$abstractFactory = $this->createMock(AbstractFactoryInterface::class);
347343

348344
$serviceManager = new SimpleServiceManager([
349-
'aliases' => [
345+
'aliases' => [
350346
'Alias' => 'ServiceName',
351347
],
352348
'abstract_factories' => [
@@ -355,13 +351,14 @@ public function testResolvedAliasNoMatchingAbstractFactoryReturnsFalse()
355351
]);
356352

357353
$abstractFactory
358-
->expects($this->any())
354+
->expects(self::any())
359355
->method('canCreate')
360356
->withConsecutive(
361-
[ $this->anything(), $this->equalTo('Alias') ],
362-
[ $this->anything(), $this->equalTo('ServiceName')]
357+
[self::anything(), 'Alias'],
358+
[self::anything(), 'ServiceName']
363359
)
364360
->willReturn(false);
365-
$this->assertFalse($serviceManager->has('Alias'));
361+
362+
self::assertFalse($serviceManager->has('Alias'));
366363
}
367364
}

0 commit comments

Comments
 (0)