ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
MercurialProcessorTest.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the Monolog package.
5  *
6  * (c) Jonathan A. Schweder <jonathanschweder@gmail.com>
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11 
12 namespace Monolog\Processor;
13 
15 
17 {
21  public function testProcessor()
22  {
23  if (defined('PHP_WINDOWS_VERSION_BUILD')) {
24  exec("where hg 2>NUL", $output, $result);
25  } else {
26  exec("which hg 2>/dev/null >/dev/null", $output, $result);
27  }
28  if ($result != 0) {
29  $this->markTestSkipped('hg is missing');
30  return;
31  }
32 
33  `hg init`;
34  $processor = new MercurialProcessor();
35  $record = $processor($this->getRecord());
36 
37  $this->assertArrayHasKey('hg', $record['extra']);
38  $this->assertTrue(!is_array($record['extra']['hg']['branch']));
39  $this->assertTrue(!is_array($record['extra']['hg']['revision']));
40  }
41 }
Injects Hg branch and Hg revision number in all records.
$result
getRecord($level=Logger::WARNING, $message='test', $context=array())
Definition: TestCase.php:19
while(count($oldTaskList) > 0) foreach(array_keys($newTaskList) as $task) init()
Definition: build.php:77