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

NullCallbackLoaderTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 44
wmc 2
lcom 0
cbo 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testCanConstruct() 0 7 1
B testInterfaceMethods() 0 32 1
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