Test Failed
Push — 1.0.0-dev ( 6506b5...225896 )
by nguereza
05:07
created

EventTest   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
eloc 21
c 1
b 1
f 0
dl 0
loc 53
rs 10
wmc 8

8 Methods

Rating   Name   Duplication   Size   Complexity  
A testStopValueIsSetToTue() 0 6 1
A tearDown() 0 2 1
A testPayloadValueIsSet() 0 6 1
A testDefaultValue() 0 6 1
A testReturnBackValueIsSetToTrue() 0 6 1
A setUpBeforeClass() 0 2 1
A setUp() 0 2 1
A tearDownAfterClass() 0 2 1
1
<?php 
2
3
	use PHPUnit\Framework\TestCase;
4
5
	class EventTest extends TestCase
6
	{	
7
	
8
		public static function setUpBeforeClass()
9
		{
10
		
11
		}
12
		
13
		public static function tearDownAfterClass()
14
		{
15
			
16
		}
17
		
18
		protected function setUp()
19
		{
20
		}
21
22
		protected function tearDown()
23
		{
24
		}
25
26
		
27
		
28
		public function testDefaultValue(){
29
			$e = new Event('foo');
0 ignored issues
show
Bug introduced by
The call to Event::__construct() has too few arguments starting with fd. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

29
			$e = /** @scrutinizer ignore-call */ new Event('foo');

This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
Bug introduced by
'foo' of type string is incompatible with the type EventBase expected by parameter $base of Event::__construct(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

29
			$e = new Event(/** @scrutinizer ignore-type */ 'foo');
Loading history...
30
			$this->assertSame($e->name, 'foo');
0 ignored issues
show
Bug introduced by
The property name does not seem to exist on Event.
Loading history...
31
			$this->assertSame($e->payload, array());
0 ignored issues
show
Bug introduced by
The property payload does not seem to exist on Event.
Loading history...
32
			$this->assertFalse($e->returnBack);
0 ignored issues
show
Bug introduced by
The property returnBack does not seem to exist on Event.
Loading history...
33
			$this->assertFalse($e->stop);
0 ignored issues
show
Bug introduced by
The property stop does not seem to exist on Event.
Loading history...
34
		}
35
		
36
		public function testPayloadValueIsSet(){
37
			$e = new Event('foo', array('bar'));
0 ignored issues
show
Bug introduced by
array('bar') of type array<integer,string> is incompatible with the type mixed expected by parameter $fd of Event::__construct(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

37
			$e = new Event('foo', /** @scrutinizer ignore-type */ array('bar'));
Loading history...
Bug introduced by
The call to Event::__construct() has too few arguments starting with what. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

37
			$e = /** @scrutinizer ignore-call */ new Event('foo', array('bar'));

This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
Bug introduced by
'foo' of type string is incompatible with the type EventBase expected by parameter $base of Event::__construct(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

37
			$e = new Event(/** @scrutinizer ignore-type */ 'foo', array('bar'));
Loading history...
38
			$this->assertSame($e->name, 'foo');
0 ignored issues
show
Bug introduced by
The property name does not seem to exist on Event.
Loading history...
39
			$this->assertSame($e->payload, array('bar'));
0 ignored issues
show
Bug introduced by
The property payload does not seem to exist on Event.
Loading history...
40
			$this->assertFalse($e->returnBack);
0 ignored issues
show
Bug introduced by
The property returnBack does not seem to exist on Event.
Loading history...
41
			$this->assertFalse($e->stop);
0 ignored issues
show
Bug introduced by
The property stop does not seem to exist on Event.
Loading history...
42
		}
43
		
44
		public function testReturnBackValueIsSetToTrue(){
45
			$e = new Event('foo', array('bar'), true);
0 ignored issues
show
Bug introduced by
array('bar') of type array<integer,string> is incompatible with the type mixed expected by parameter $fd of Event::__construct(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

45
			$e = new Event('foo', /** @scrutinizer ignore-type */ array('bar'), true);
Loading history...
Bug introduced by
true of type true is incompatible with the type integer expected by parameter $what of Event::__construct(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

45
			$e = new Event('foo', array('bar'), /** @scrutinizer ignore-type */ true);
Loading history...
Bug introduced by
The call to Event::__construct() has too few arguments starting with cb. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

45
			$e = /** @scrutinizer ignore-call */ new Event('foo', array('bar'), true);

This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
Bug introduced by
'foo' of type string is incompatible with the type EventBase expected by parameter $base of Event::__construct(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

45
			$e = new Event(/** @scrutinizer ignore-type */ 'foo', array('bar'), true);
Loading history...
46
			$this->assertSame($e->name, 'foo');
0 ignored issues
show
Bug introduced by
The property name does not seem to exist on Event.
Loading history...
47
			$this->assertSame($e->payload, array('bar'));
0 ignored issues
show
Bug introduced by
The property payload does not seem to exist on Event.
Loading history...
48
			$this->assertTrue($e->returnBack);
0 ignored issues
show
Bug introduced by
The property returnBack does not seem to exist on Event.
Loading history...
49
			$this->assertFalse($e->stop);
0 ignored issues
show
Bug introduced by
The property stop does not seem to exist on Event.
Loading history...
50
		}
51
		
52
		public function testStopValueIsSetToTue(){
53
			$e = new Event('foo', array('bar'), true, true);
0 ignored issues
show
Bug introduced by
true of type true is incompatible with the type callable expected by parameter $cb of Event::__construct(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

53
			$e = new Event('foo', array('bar'), true, /** @scrutinizer ignore-type */ true);
Loading history...
Bug introduced by
array('bar') of type array<integer,string> is incompatible with the type mixed expected by parameter $fd of Event::__construct(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

53
			$e = new Event('foo', /** @scrutinizer ignore-type */ array('bar'), true, true);
Loading history...
Bug introduced by
'foo' of type string is incompatible with the type EventBase expected by parameter $base of Event::__construct(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

53
			$e = new Event(/** @scrutinizer ignore-type */ 'foo', array('bar'), true, true);
Loading history...
Bug introduced by
true of type true is incompatible with the type integer expected by parameter $what of Event::__construct(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

53
			$e = new Event('foo', array('bar'), /** @scrutinizer ignore-type */ true, true);
Loading history...
54
			$this->assertSame($e->name, 'foo');
0 ignored issues
show
Bug introduced by
The property name does not seem to exist on Event.
Loading history...
55
			$this->assertSame($e->payload, array('bar'));
0 ignored issues
show
Bug introduced by
The property payload does not seem to exist on Event.
Loading history...
56
			$this->assertTrue($e->returnBack);
0 ignored issues
show
Bug introduced by
The property returnBack does not seem to exist on Event.
Loading history...
57
			$this->assertTrue($e->stop);
0 ignored issues
show
Bug introduced by
The property stop does not seem to exist on Event.
Loading history...
58
		}
59
	}