Skip to content

Commit 2737319

Browse files
committed
corrections/code coverage fix
1 parent 698347a commit 2737319

File tree

2 files changed

+6
-40
lines changed

2 files changed

+6
-40
lines changed

lib/DInjector.php

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -31,35 +31,10 @@ public function set($abstract, $concrete = NULL)
3131
if ($concrete === NULL) {
3232
$concrete = $abstract;
3333
}
34+
3435
$this->instances[$abstract] = $concrete;
3536
}
36-
37-
/**
38-
* For compatibility with other containers, same as set()
39-
*/
40-
public function register($abstract, $concrete = NULL)
41-
{
42-
$this->set($abstract, $concrete);
43-
}
4437

45-
/**
46-
* Execute with any dependencies
47-
*
48-
* @param $abstract
49-
* @param array $values
50-
*
51-
* @return mixed
52-
* @throws ContainerException
53-
*/
54-
public function call($abstract, $values = [])
55-
{
56-
$concrete = $this->instances[$abstract];
57-
if ($concrete instanceof \Closure) {
58-
return $concrete($this, $values);
59-
} else
60-
throw new ContainerException("{$concrete} is not callable");
61-
}
62-
6338
/**
6439
* @param $abstract
6540
*

tests/DInjectorTest.php

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@
1616
class DInjectorTest extends EZTestCase
1717
{
1818
/**
19-
* @covers ezsql\DInjector::Set
19+
* @covers ezsql\DInjector::set
2020
*/
2121
public function testSet()
2222
{
2323
$container = new DInjector();
2424
$this->assertTrue($container instanceof ContainerInterface);
25-
$container->set('Baz', 'Baz');
25+
$container->set('Baz');
2626
$this->assertTrue($container->has('Baz'));
2727
}
2828

2929
/**
30-
* @covers ezsql\DInjector::Has
30+
* @covers ezsql\DInjector::has
3131
*/
3232
public function testHas()
3333
{
@@ -38,7 +38,7 @@ public function testHas()
3838
}
3939

4040
/**
41-
* @covers ezsql\DInjector::AutoWire
41+
* @covers ezsql\DInjector::autoWire
4242
*/
4343
public function testAutoWire()
4444
{
@@ -50,19 +50,13 @@ public function testAutoWire()
5050
$this->assertTrue($baz->foo instanceof Foo);
5151
}
5252

53-
/**
54-
* @covers ezsql\DInjector::AutoWire
55-
*/
5653
public function testAutoWire_Exception()
5754
{
5855
$container = new DInjector();
5956
$this->expectException(\ReflectionException::class);
6057
$baz = $container->autoWire('Baz');
6158
}
6259

63-
/**
64-
* @covers ezsql\DInjector::AutoWire
65-
*/
6660
public function testAutoWire_Error()
6761
{
6862
$container = new DInjector();
@@ -72,7 +66,7 @@ public function testAutoWire_Error()
7266
}
7367

7468
/**
75-
* @covers ezsql\DInjector::Get
69+
* @covers ezsql\DInjector::get
7670
*/
7771
public function testGet()
7872
{
@@ -84,9 +78,6 @@ public function testGet()
8478
$this->assertTrue($baz->foo instanceof Bar);
8579
}
8680

87-
/**
88-
* @covers ezsql\DInjector::Get
89-
*/
9081
public function testGet_Error()
9182
{
9283
$container = new DInjector();

0 commit comments

Comments
 (0)