GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

testValidationWithUnmappedPropertiesShouldPass()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 1 Features 1
Metric Value
c 2
b 1
f 1
dl 0
loc 8
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
3
namespace Papper\Tests;
4
5
use Papper\TypeMap;
6
7
class TypeMapTest extends TestCaseBase
8
{
9
	public function testGetUnmappedProperty()
10
	{
11
		// arrange
12
		$mappedPropertyMap = self::createMappedProperty();
13
		$unmappedPropertyMap = self::createUnmappedProperty();
14
15
		$typeMap = new TypeMap('SomeType', 'AnotherType', \Mockery::mock('Papper\ObjectCreatorInterface'));
16
		$typeMap->addPropertyMap($mappedPropertyMap);
17
		$typeMap->addPropertyMap($unmappedPropertyMap);
18
		// act
19
		$unmappedProperties = $typeMap->getUnmappedPropertyMaps();
20
		// assert
21
		$this->assertCount(1, $unmappedProperties);
22
		$this->assertSame($unmappedPropertyMap, $unmappedProperties['unmapped']);
23
	}
24
25
	public function testValidationWithUnmappedPropertiesShouldPass()
26
	{
27
		// arrange
28
		$typeMap = new TypeMap('SomeType', 'AnotherType', \Mockery::mock('Papper\ObjectCreatorInterface'));
29
		$typeMap->addPropertyMap(self::createMappedProperty());
30
		// act
31
		$typeMap->validate();
32
	}
33
34
	public function testValidationWithUnmappedPropertiesShouldThrowException()
35
	{
36
		$this->setExpectedException('Papper\ValidationException');
37
		// arrange
38
		$typeMap = new TypeMap('SomeType', 'AnotherType', \Mockery::mock('Papper\ObjectCreatorInterface'));
39
		$typeMap->addPropertyMap(self::createMappedProperty());
40
		$typeMap->addPropertyMap(self::createUnmappedProperty());
41
		// act
42
		$typeMap->validate();
43
	}
44
45
	private static function createMappedProperty()
46
	{
47
		$mock = \Mockery::mock('Papper\PropertyMap');
48
		$mock->shouldReceive('getMemberName')->andReturn('mapped');
49
		$mock->shouldReceive('isMapped')->andReturn(true);
50
		return $mock;
51
	}
52
53
	private static function createUnmappedProperty()
54
	{
55
		$mock = \Mockery::mock('Papper\PropertyMap');
56
		$mock->shouldReceive('getMemberName')->andReturn('unmapped');
57
		$mock->shouldReceive('isMapped')->andReturn(false);
58
		return $mock;
59
	}
60
}
61