Completed
Pull Request — development (#720)
by Thomas
24:05
created

XmlsessionEntityTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 14
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testEntity() 0 11 1
1
<?php 
2
3
 use OcTest\Modules\AbstractModuleTest; 
4
5
class XmlsessionEntityTest extends AbstractModuleTest
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
6
{
7
	public function testEntity()
8
	{
9
		$entity = new XmlsessionEntity();
10
		        self::assertTrue($entity->isNew());
11
		    $entity->id = mt_rand(0, 100);$entity->users = mt_rand(0, 100);$entity->caches = mt_rand(0, 100);$entity->cachedescs = mt_rand(0, 100);$entity->cachelogs = mt_rand(0, 100);$entity->pictures = mt_rand(0, 100);$entity->removedobjects = mt_rand(0, 100);$entity->cleaned = mt_rand(0, 100);$entity->agent = md5(time());
12
		        $newEntity = new XmlsessionEntity();
13
		        $newEntity->fromArray($entity->toArray());
14
15
		        self::assertEquals($entity, $newEntity);
16
		        self::assertFalse($entity->isNew());
17
	}
18
}
19