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.
Completed
Push — master ( a111ac...84e69f )
by Florian
03:10
created

DocumentAdapterTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testAddFields() 0 21 1
1
<?php
2
3
/*
4
 * This file is part of the Stinger Enity Search package.
5
 *
6
 * (c) Oliver Kotte <[email protected]>
7
 * (c) Florian Meyer <[email protected]>
8
 *
9
 * For the full copyright and license information, please view the LICENSE
10
 * file that was distributed with this source code.
11
 */
12
namespace StingerSoft\EntitySearchBundle\Tests\Model;
13
14
use StingerSoft\EntitySearchBundle\Model\DocumentAdapter;
15
use StingerSoft\EntitySearchBundle\Tests\Fixtures\ORM\Beer;
16
use StingerSoft\EntitySearchBundle\Model\Document;
17
18
class DocumentAdapterTest extends \PHPUnit_Framework_TestCase {
19
20
	public function testAddFields() {
21
		$doc = new DocumentAdapter();
22
		
23
		$doc->setEntityClass(Beer::class);
24
		$doc->setEntityId(1);
25
		$doc->addField(Document::FIELD_AUTHOR, 'florian_meyer');
26
		$doc->addMultiValueField(Document::FIELD_EDITORS, 'florian_meyer');
27
		$doc->addMultiValueField(Document::FIELD_EDITORS, 'oliver_kotte');
28
		
29
		$this->assertEquals(Beer::class, $doc->getEntityClass());
30
		$this->assertEquals(1, $doc->getEntityId());
31
		
32
		$fields = $doc->getFields();
33
		$this->assertArrayHasKey(Document::FIELD_AUTHOR, $fields);
34
		$this->assertNotNull($doc->getFieldValue(Document::FIELD_AUTHOR));
35
		$this->assertArrayHasKey(Document::FIELD_EDITORS, $fields);
36
		$this->assertNotNull($doc->getFieldValue(Document::FIELD_EDITORS));
37
		$this->assertContains('florian_meyer', $fields[Document::FIELD_EDITORS]);
38
		
39
		$this->assertNull($doc->getFieldValue(Document::FIELD_ROLES));
40
	}
41
}