Repository navigation
Expand file tree
/
Copy pathTest.php
More file actions
87 lines (74 loc) · 1.97 KB
/
Copy pathTest.php
File metadata and controls
87 lines (74 loc) · 1.97 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?php
namespace Codeception\TestCase;
use Codeception\Configuration;
use Codeception\Events;
use Codeception\Event\TestEvent;
use Codeception\Exception\TestRuntime;
use Codeception\SuiteManager;
use Codeception\TestCase;
class Test extends TestCase implements
Interfaces\Descriptive,
Interfaces\Configurable
{
use Shared\Actor;
use Shared\Dependencies;
protected function setUp()
{
$actor = $this->actor;
if ($actor) {
$property = lcfirst(Configuration::config()['actor']);
$this->$property = new $actor($this->scenario);
// BC compatibility hook
$actorProperty = lcfirst($actor);
$this->$actorProperty = $this->$property;
}
$this->getScenario()->run();
$this->fire(Events::TEST_BEFORE, new TestEvent($this));
$this->_before();
}
/**
* @Override
*/
protected function _before()
{
}
protected function tearDown()
{
$this->_after();
$this->fire(Events::TEST_AFTER, new TestEvent($this));
}
/**
* @Override
*/
protected function _after()
{
}
public function getFeature()
{
$text = $this->getName();
$text = preg_replace('/([A-Z]+)([A-Z][a-z])/', '\\1 \\2', $text);
$text = preg_replace('/([a-z\d])([A-Z])/', '\\1 \\2', $text);
return strtolower($text);
}
public function getSignature()
{
return get_class($this).'::'.$this->getName(false);
}
public function getFileName()
{
return (new \ReflectionClass($this))->getFileName();
}
/**
* @param $module
*
* @return \Codeception\Module
* @throws \Codeception\Exception\TestRuntime
*/
public function getModule($module)
{
if (SuiteManager::hasModule($module)) {
return SuiteManager::$modules[$module];
}
throw new TestRuntime("Module $module is not enabled for this test suite");
}
}