forked from cakephp/codeception
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHelper.php
More file actions
61 lines (54 loc) · 1.35 KB
/
Copy pathHelper.php
File metadata and controls
61 lines (54 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
namespace Cake\Codeception;
use Cake\Codeception\Helper\AuthTrait;
use Cake\Codeception\Helper\DispatcherTrait;
use Cake\Codeception\Helper\RouterTrait;
use Cake\Codeception\Helper\SessionTrait;
use Cake\Codeception\Helper\ViewTrait;
use Cake\Routing\Router;
use Codeception\TestCase;
class Helper extends Framework
{
use AuthTrait;
use DispatcherTrait;
use RouterTrait;
use SessionTrait;
use ViewTrait;
// @codingStandardsIgnoreStart
public function _before(TestCase $test) // @codingStandardsIgnoreEnd
{
parent::_before($test);
$this->client = $this->getConnectorInstance();
$this->reloadRoutes();
}
/**
* Returns one of the instantiated services
*
* @param [type] $class [description]
* @return object Cake object of requested type.
* @see \Cake\Codeception\Connector::$cake
*/
public function grabService($class)
{
return $this->client->cake[$class];
}
/**
* Reloads the defined routes.
*
* @return void
*/
protected function reloadRoutes()
{
Router::reload();
}
/**
* Instantiate a connector.
*
* @param array $server
* @return \Cake\Codeception\Connector
*/
protected function getConnectorInstance(array $server = [])
{
return new Connector($server);
}
}