2
2
3
3
namespace Codeception \Module ;
4
4
5
+ use Codeception \Util \Framework ;
6
+ use Nette \Configurator ;
7
+ use Nette \InvalidStateException ;
8
+ use Nette \DI \Container ;
9
+ use Nette \DI \MissingServiceException ;
10
+ use Nette \Loaders \RobotLoader ;
5
11
use Nette \Utils \Validators ;
12
+ use RecursiveDirectoryIterator ;
13
+ use RecursiveIteratorIterator ;
6
14
7
- class Nette extends \ Codeception \ Util \ Framework
15
+ class Nette extends Framework
8
16
{
9
17
10
- /** @var \Nette\DI\ Container */
18
+ /** @var Container */
11
19
protected $ container ;
12
20
13
- /** @var \Nette\Loaders\ RobotLoader */
21
+ /** @var RobotLoader */
14
22
private $ robotLoader ;
15
23
16
24
/**
@@ -42,7 +50,7 @@ public function _beforeSuite($settings = array())
42
50
$ tempDir = $ this ->config ['tempDir ' ] . DIRECTORY_SEPARATOR . $ suite ;
43
51
44
52
self ::purge ($ tempDir );
45
- $ configurator = new \ Nette \ Config \ Configurator ();
53
+ $ configurator = new Configurator ();
46
54
$ configurator ->setTempDirectory ($ tempDir );
47
55
$ configurator ->addParameters (array (
48
56
'container ' => array (
@@ -75,20 +83,20 @@ public function grabService($service)
75
83
{
76
84
try {
77
85
return $ this ->container ->getByType ($ service );
78
- } catch (\ Nette \ DI \ MissingServiceException $ e ) {
86
+ } catch (MissingServiceException $ e ) {
79
87
$ this ->fail ($ e ->getMessage ());
80
88
}
81
89
}
82
90
83
91
private function detectSuiteName ($ settings )
84
92
{
85
93
if (!isset ($ settings ['path ' ])) {
86
- throw new \ Nette \ InvalidStateException ('Could not detect suite name, path is not set. ' );
94
+ throw new InvalidStateException ('Could not detect suite name, path is not set. ' );
87
95
}
88
96
$ directory = rtrim ($ settings ['path ' ], DIRECTORY_SEPARATOR );
89
97
$ position = strrpos ($ directory , DIRECTORY_SEPARATOR );
90
98
if ($ position === FALSE ) {
91
- throw new \ Nette \ InvalidStateException ('Could not detect suite name, path is invalid. ' );
99
+ throw new InvalidStateException ('Could not detect suite name, path is invalid. ' );
92
100
}
93
101
return substr ($ directory , $ position + 1 );
94
102
}
@@ -102,7 +110,7 @@ protected static function purge($dir)
102
110
if (!is_dir ($ dir )) {
103
111
mkdir ($ dir );
104
112
}
105
- foreach (new \ RecursiveIteratorIterator (new \ RecursiveDirectoryIterator ($ dir ), \ RecursiveIteratorIterator::CHILD_FIRST ) as $ entry ) {
113
+ foreach (new RecursiveIteratorIterator (new RecursiveDirectoryIterator ($ dir ), RecursiveIteratorIterator::CHILD_FIRST ) as $ entry ) {
106
114
if (substr ($ entry ->getBasename (), 0 , 1 ) === '. ' ) {
107
115
// nothing
108
116
} elseif ($ entry ->isDir ()) {
0 commit comments