Completed
Branch master (136162)
by Aimeos
06:57
created

SupportTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 16
dl 0
loc 36
rs 10
c 1
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testCheckGroup() 0 8 1
A testGetGroups() 0 11 1
A testCheckUserGroup() 0 9 1
1
<?php
2
3
class SupportTest extends AimeosTestAbstract
4
{
5
	public function testCheckUserGroup()
6
	{
7
		$context = $this->app->make( '\Aimeos\Shop\Base\Context' );
8
		$locale = $this->app->make( '\Aimeos\Shop\Base\Locale' );
9
10
		$object = new \Aimeos\Shop\Base\Support( $context, $locale );
11
		$user = new \Illuminate\Foundation\Auth\User();
12
13
		$this->assertFalse( $object->checkUserGroup( $user, 'admin' ) );
14
	}
15
16
17
	public function testCheckGroup()
18
	{
19
		$context = $this->app->make( '\Aimeos\Shop\Base\Context' );
20
		$locale = $this->app->make( '\Aimeos\Shop\Base\Locale' );
21
22
		$object = new \Aimeos\Shop\Base\Support( $context, $locale );
23
24
		$this->assertFalse( $object->checkGroup( -1, 'admin' ) );
25
	}
26
27
28
	public function testGetGroups()
29
	{
30
		$context = $this->app->make( '\Aimeos\Shop\Base\Context' );
31
		$locale = $this->app->make( '\Aimeos\Shop\Base\Locale' );
32
33
		$ctx = $context->get( false );
34
		$ctx->setLocale( $locale->getBackend( $ctx, 'unittest' ) );
35
36
		$object = new \Aimeos\Shop\Base\Support( $context, $locale );
37
38
		$this->assertEquals( array(), $object->getGroups( $ctx ) );
39
	}
40
}
41