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 33namespace Arachne \Codeception \Util \Connector ;
44
55use Nette \DI \Container ;
6- use Nette \Diagnostics \Debugger ;
76use Nette \Environment ;
87use Nette \Http \IResponse ;
98use Symfony \Component \BrowserKit \Client ;
@@ -50,13 +49,7 @@ public function doRequest($request)
5049 $ httpResponse ->setCode (IResponse::S200_OK );
5150
5251 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 ();
6053 $ content = ob_get_clean ();
6154
6255 $ code = $ httpResponse ->getCode ();
Original file line number Diff line number Diff line change 88use Nette \Configurator ;
99use Nette \DI \Container ;
1010use Nette \DI \MissingServiceException ;
11- use Nette \Diagnostics \Debugger ;
1211use Nette \InvalidStateException ;
13- use Nette \Loaders \RobotLoader ;
1412use Nette \Utils \Validators ;
1513use RecursiveDirectoryIterator ;
1614use RecursiveIteratorIterator ;
@@ -47,7 +45,6 @@ protected function validateConfig()
4745 Validators::assertField ($ this ->config , 'configFiles ' , 'array ' );
4846 }
4947
50- // TODO: separate Tracy module (exceptions logging)
5148 // TODO: separate ArachneTools module (debugContent method)
5249 public function _beforeSuite ($ settings = array ())
5350 {
@@ -56,7 +53,6 @@ public function _beforeSuite($settings = array())
5653 $ this ->detectSuiteName ($ settings );
5754 $ path = pathinfo ($ settings ['path ' ], PATHINFO_DIRNAME );
5855 $ tempDir = $ path . DIRECTORY_SEPARATOR . '_temp ' . DIRECTORY_SEPARATOR . $ this ->suite ;
59- Debugger::$ logDirectory = $ path . DIRECTORY_SEPARATOR . '_log ' ;
6056
6157 self ::purge ($ tempDir );
6258 $ this ->configurator = new Configurator ();
You can’t perform that action at this time.
0 commit comments