Merge pull request #27 from kamermans/master
Build error: Fatal error: Using $this when not in object context
This commit is contained in:
commit
9848fa42d9
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -4,3 +4,6 @@ composer.lock
|
|||
composer.phar
|
||||
config.php
|
||||
.DS_Store
|
||||
.settings/
|
||||
.project
|
||||
.buildpath
|
||||
|
|
|
@ -96,17 +96,17 @@ class Builder
|
|||
|
||||
if(is_array($message))
|
||||
{
|
||||
$cb = $this->logCallback;
|
||||
|
||||
$message = array_map(function($item) use ($cb, $prefix)
|
||||
|
||||
foreach ($message as $item)
|
||||
{
|
||||
if(is_callable($cb))
|
||||
if(is_callable($this->logCallback))
|
||||
{
|
||||
$cb($prefix . $item);
|
||||
$this->logCallback($prefix . $item);
|
||||
}
|
||||
|
||||
|
||||
$this->log .= $prefix . $item . PHP_EOL;
|
||||
}, $message);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -7,10 +7,15 @@ class PhpUnit implements \PHPCI\Plugin
|
|||
protected $directory;
|
||||
protected $args;
|
||||
protected $phpci;
|
||||
|
||||
/**
|
||||
* @var string $runFrom When running PHPUnit with an XML config, the command is run from this directory
|
||||
*/
|
||||
protected $runFrom;
|
||||
|
||||
/**
|
||||
* @var string $xmlConfigFile The path of an xml config for PHPUnit
|
||||
*/
|
||||
/**
|
||||
* @var string $xmlConfigFile The path of an xml config for PHPUnit
|
||||
*/
|
||||
protected $xmlConfigFile;
|
||||
|
||||
public function __construct(\PHPCI\Builder $phpci, array $options = array())
|
||||
|
@ -18,6 +23,7 @@ class PhpUnit implements \PHPCI\Plugin
|
|||
$this->phpci = $phpci;
|
||||
$this->directory = isset($options['directory']) ? $options['directory'] : null;
|
||||
$this->xmlConfigFile = isset($options['config']) ? $options['config'] : null;
|
||||
$this->runFrom = isset($options['run_from']) ? $options['run_from'] : null;
|
||||
$this->args = isset($options['args']) ? $options['args'] : '';
|
||||
}
|
||||
|
||||
|
@ -48,7 +54,15 @@ class PhpUnit implements \PHPCI\Plugin
|
|||
}
|
||||
else
|
||||
{
|
||||
return $this->phpci->executeCommand(PHPCI_BIN_DIR . 'phpunit ' . $this->args . ' -c ' . $this->phpci->buildPath . $configPath);
|
||||
if ($this->runFrom) {
|
||||
$curdir = getcwd();
|
||||
chdir($this->phpci->buildPath.'/'.$this->runFrom);
|
||||
}
|
||||
$success = $this->phpci->executeCommand(PHPCI_BIN_DIR . 'phpunit ' . $this->args . ' -c ' . $this->phpci->buildPath . $configPath);
|
||||
if ($this->runFrom) {
|
||||
chdir($curdir);
|
||||
}
|
||||
return $success;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue