Completed
Push — master ( cf3a23...901aad )
by mw
8s
created

NullCallbackLoaderTest::testInterfaceMethods()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 32
Code Lines 17

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 32
rs 8.8571
cc 1
eloc 17
nc 1
nop 0
1
<?php
2
3
namespace Onoi\CallbackContainer\Tests;
4
5
use Onoi\CallbackContainer\NullCallbackLoader;
6
7
/**
8
 * @covers \Onoi\CallbackContainer\NullCallbackLoader
9
 * @group onoi-callback-container
10
 *
11
 * @license GNU GPL v2+
12
 * @since 1.0
13
 *
14
 * @author mwjames
15
 */
16
class NullCallbackLoaderTest extends \PHPUnit_Framework_TestCase {
17
18
	public function testCanConstruct() {
19
20
		$this->assertInstanceOf(
21
			'\Onoi\CallbackContainer\NullCallbackLoader',
22
			new NullCallbackLoader()
0 ignored issues
show
Deprecated Code introduced by
The class Onoi\CallbackContainer\NullCallbackLoader has been deprecated with message: since 1.1, use NullCallbackInstantiator

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
23
		);
24
	}
25
26
	public function testInterfaceMethods() {
27
28
		$instance = new NullCallbackLoader();
0 ignored issues
show
Deprecated Code introduced by
The class Onoi\CallbackContainer\NullCallbackLoader has been deprecated with message: since 1.1, use NullCallbackInstantiator

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
29
30
		$this->assertNull(
31
			$instance->load( 'Foo' )
32
		);
33
34
		$this->assertNull(
35
			$instance->create( 'Foo' )
36
		);
37
38
		$this->assertNull(
39
			$instance->singleton( 'Foo' )
40
		);
41
42
		$this->assertNull(
43
			$instance->registerExpectedReturnType( 'Foo', 'bar' )
44
		);
45
46
		$this->assertNull(
47
			$instance->registerCallback( 'Foo', function() {} )
48
		);
49
50
		$callbackContainer = $this->getMockBuilder( '\Onoi\CallbackContainer\CallbackContainer' )
51
			->disableOriginalConstructor()
52
			->getMock();
53
54
		$this->assertNull(
55
			$instance->registerCallbackContainer( $callbackContainer )
56
		);
57
	}
58
59
}
60