22
33namespace Codeception \Module ;
44
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 ;
511use Nette \Utils \Validators ;
12+ use RecursiveDirectoryIterator ;
13+ use RecursiveIteratorIterator ;
614
7- class Nette extends \ Codeception \ Util \ Framework
15+ class Nette extends Framework
816{
917
10- /** @var \Nette\DI\ Container */
18+ /** @var Container */
1119 protected $ container ;
1220
13- /** @var \Nette\Loaders\ RobotLoader */
21+ /** @var RobotLoader */
1422 private $ robotLoader ;
1523
1624 /**
@@ -42,7 +50,7 @@ public function _beforeSuite($settings = array())
4250 $ tempDir = $ this ->config ['tempDir ' ] . DIRECTORY_SEPARATOR . $ suite ;
4351
4452 self ::purge ($ tempDir );
45- $ configurator = new \ Nette \ Config \ Configurator ();
53+ $ configurator = new Configurator ();
4654 $ configurator ->setTempDirectory ($ tempDir );
4755 $ configurator ->addParameters (array (
4856 'container ' => array (
@@ -75,20 +83,20 @@ public function grabService($service)
7583 {
7684 try {
7785 return $ this ->container ->getByType ($ service );
78- } catch (\ Nette \ DI \ MissingServiceException $ e ) {
86+ } catch (MissingServiceException $ e ) {
7987 $ this ->fail ($ e ->getMessage ());
8088 }
8189 }
8290
8391 private function detectSuiteName ($ settings )
8492 {
8593 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. ' );
8795 }
8896 $ directory = rtrim ($ settings ['path ' ], DIRECTORY_SEPARATOR );
8997 $ position = strrpos ($ directory , DIRECTORY_SEPARATOR );
9098 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. ' );
92100 }
93101 return substr ($ directory , $ position + 1 );
94102 }
@@ -102,7 +110,7 @@ protected static function purge($dir)
102110 if (!is_dir ($ dir )) {
103111 mkdir ($ dir );
104112 }
105- foreach (new \ RecursiveIteratorIterator (new \ RecursiveDirectoryIterator ($ dir ), \ RecursiveIteratorIterator::CHILD_FIRST ) as $ entry ) {
113+ foreach (new RecursiveIteratorIterator (new RecursiveDirectoryIterator ($ dir ), RecursiveIteratorIterator::CHILD_FIRST ) as $ entry ) {
106114 if (substr ($ entry ->getBasename (), 0 , 1 ) === '. ' ) {
107115 // nothing
108116 } elseif ($ entry ->isDir ()) {
0 commit comments