File tree Expand file tree Collapse file tree 3 files changed +34
-12
lines changed Expand file tree Collapse file tree 3 files changed +34
-12
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Arachne \Codeception \Tracy ;
4
+
5
+ use Codeception \Events ;
6
+ use Codeception \Event \FailEvent ;
7
+ use Codeception \Platform \Extension ;
8
+ use Tracy \Debugger ;
9
+
10
+ class Logger extends Extension
11
+ {
12
+
13
+ static $ events = [
14
+ Events::TEST_FAIL => 'testFail ' ,
15
+ Events::TEST_ERROR => 'testError ' ,
16
+ ];
17
+
18
+ public function __construct ()
19
+ {
20
+ Debugger::$ logDirectory = $ this ->getLogDir ();
21
+ }
22
+
23
+ public function testFail (FailEvent $ e )
24
+ {
25
+ Debugger::log ($ e ->getFail ());
26
+ }
27
+
28
+ public function testError (FailEvent $ e )
29
+ {
30
+ Debugger::log ($ e ->getFail ());
31
+ }
32
+
33
+ }
Original file line number Diff line number Diff line change 3
3
namespace Arachne \Codeception \Util \Connector ;
4
4
5
5
use Nette \DI \Container ;
6
- use Nette \Diagnostics \Debugger ;
7
6
use Nette \Environment ;
8
7
use Nette \Http \IResponse ;
9
8
use Symfony \Component \BrowserKit \Client ;
@@ -50,13 +49,7 @@ public function doRequest($request)
50
49
$ httpResponse ->setCode (IResponse::S200_OK );
51
50
52
51
ob_start ();
53
- try {
54
- $ this ->container ->getByType ('Nette\Application\Application ' )->run ();
55
- } catch (\Exception $ e ) {
56
- ob_end_clean ();
57
- Debugger::log ($ e );
58
- throw $ e ;
59
- }
52
+ $ this ->container ->getByType ('Nette\Application\Application ' )->run ();
60
53
$ content = ob_get_clean ();
61
54
62
55
$ code = $ httpResponse ->getCode ();
Original file line number Diff line number Diff line change 8
8
use Nette \Configurator ;
9
9
use Nette \DI \Container ;
10
10
use Nette \DI \MissingServiceException ;
11
- use Nette \Diagnostics \Debugger ;
12
11
use Nette \InvalidStateException ;
13
- use Nette \Loaders \RobotLoader ;
14
12
use Nette \Utils \Validators ;
15
13
use RecursiveDirectoryIterator ;
16
14
use RecursiveIteratorIterator ;
@@ -47,7 +45,6 @@ protected function validateConfig()
47
45
Validators::assertField ($ this ->config , 'configFiles ' , 'array ' );
48
46
}
49
47
50
- // TODO: separate Tracy module (exceptions logging)
51
48
// TODO: separate ArachneTools module (debugContent method)
52
49
public function _beforeSuite ($ settings = array ())
53
50
{
@@ -56,7 +53,6 @@ public function _beforeSuite($settings = array())
56
53
$ this ->detectSuiteName ($ settings );
57
54
$ path = pathinfo ($ settings ['path ' ], PATHINFO_DIRNAME );
58
55
$ tempDir = $ path . DIRECTORY_SEPARATOR . '_temp ' . DIRECTORY_SEPARATOR . $ this ->suite ;
59
- Debugger::$ logDirectory = $ path . DIRECTORY_SEPARATOR . '_log ' ;
60
56
61
57
self ::purge ($ tempDir );
62
58
$ this ->configurator = new Configurator ();
You can’t perform that action at this time.
0 commit comments