Last active
August 29, 2015 14:18
-
-
Save mdarse/4028dffd9bb5fdb57889 to your computer and use it in GitHub Desktop.
PHPUnit global notifier
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
alias phpunit="phpunit --bootstrap bootstrap_listener.php" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
PHPUnitNotifier\ConfigurationOverride::setup(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace PHPUnitNotifier; | |
use LogicException; | |
use PHPUnit_Util_Configuration as Configuration; | |
class ConfigurationOverride | |
{ | |
public static function setup() | |
{ | |
runkit_method_rename(Configuration::class, 'getListenerConfiguration', '__wrapped__getListenerConfiguration'); | |
runkit_method_copy(Configuration::class , 'getListenerConfiguration' , self::class); | |
} | |
private function __construct() {} | |
public function getListenerConfiguration() | |
{ | |
$listeners = $this->__wrapped__getListenerConfiguration(); | |
$listeners[] = [ | |
'class' => NotifierListener::class, | |
'file' => '', | |
'arguments' => [] | |
]; | |
return $listeners; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment