Completed
Push — master ( 420f16...68b944 )
by Alexander
03:24
created

SessionFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 1
c 3
b 0
f 0
lcom 0
cbo 2
dl 0
loc 16
ccs 2
cts 2
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A createSession() 0 4 1
1
<?php
2
/**
3
 * This file is part of the phpunit-mink library.
4
 * For the full copyright and license information, please view
5
 * the LICENSE file that was distributed with this source code.
6
 *
7
 * @copyright Alexander Obuhovich <[email protected]>
8
 * @link      https://github.com/aik099/phpunit-mink
9
 */
10
11
namespace aik099\PHPUnit\Session;
12
13
14
use aik099\PHPUnit\BrowserConfiguration\BrowserConfiguration;
15
use Behat\Mink\Session;
16
17
/**
18
 * Produces sessions.
19
 *
20
 * @method \Mockery\Expectation shouldReceive(string $name)
21
 */
22
class SessionFactory implements ISessionFactory
23
{
24
25
	/**
26
	 * Creates new session based on browser configuration.
27
	 *
28
	 * @param BrowserConfiguration $browser Browser configuration.
29
	 *
30
	 * @return Session
31
	 */
32 5
	public function createSession(BrowserConfiguration $browser)
33
	{
34 5
		return new SessionProxy($browser->createDriver());
35
	}
36
37
}
38