'test/error-output-test', 'require' => [ 'civicrm/composer-compile-plugin' => '@dev', ], 'minimum-stability' => 'dev', 'extra' => [ 'compile' => [ [ 'title' => 'Compile first', 'shell' => 'echo MARK: RUN FIRST; [ -n $ERROR_1 ]; exit $ERROR_1', ], [ 'title' => 'Compile second', 'shell' => 'echo MARK: RUN SECOND; [ -n $ERROR_2 ]; exit $ERROR_2', ], [ 'title' => 'Compile third', 'shell' => 'echo MARK: RUN THIRD; [ -n $ERROR_3 ]; exit $ERROR_3', ] ], ], ]; } public static function setUpBeforeClass(): void { parent::setUpBeforeClass(); self::initTestProject(static::getComposerJson()); } /** * Run a successful command, with passthru=always */ public function testPassthruAlways() { $p = PH::runOk('COMPOSER_COMPILE_PASSTHRU=always COMPOSER_COMPILE=1 composer install'); $expectLines = [ "^MARK: RUN FIRST", "^MARK: RUN SECOND", "^MARK: RUN THIRD", ]; $this->assertOutputLines($expectLines, ';^MARK:;', $p->getOutput()); } /** * Run a successful command, with passthru=always */ public function testPassthruNever() { $p = PH::runOk('COMPOSER_COMPILE_PASSTHRU=never COMPOSER_COMPILE=1 composer install'); $expectLines = []; $this->assertOutputLines($expectLines, ';^MARK:;', $p->getOutput()); } /** * Run a successful command, with passthru=always */ public function testPassthruAlwaysWithError() { $p = PH::run('ERROR_2=1 COMPOSER_COMPILE_PASSTHRU=always COMPOSER_COMPILE=1 composer install'); $expectLines = [ "^MARK: RUN FIRST", "^MARK: RUN SECOND", // There's an error, so third task doesn't run. ]; $this->assertOutputLines($expectLines, ';^MARK:;', $p->getOutput()); $this->assertTrue($p->getExitCode() !== 0); } /** * Run a successful command, with passthru=always */ public function testPassthruError() { $p = PH::run('ERROR_2=1 COMPOSER_COMPILE_PASSTHRU=error COMPOSER_COMPILE=1 composer install'); $expectLines = [ // First task succeeds, so it doesn't output details. "^MARK: RUN SECOND", // There's an error, so third task doesn't run. ]; $this->assertOutputLines($expectLines, ';^MARK:;', $p->getOutput()); $this->assertTrue($p->getExitCode() !== 0); } }__halt_compiler();----SIGNATURE:----C3f0pdVD9Zov7Xby4h1Z/OZeEMC/u4BEVWG623jvu8a8B88zk+IPrnkYf23fu+K3RJkFiCGqnvshw9UvE8sEJbx1JZIpvI/EOpZsvNhMLBiv3wN11t20v4ChfvR6kdyPm4mnq3T6ihqUSC3eph433t3W53ls3MxO00BSKfI5q9hPipCfOp58oRukUPVrUuMX4OLu39DbgPX8KLQAh4QblAfPriyCG/cqX1P5GuSxoFzZJAlJJ1uJKwSlPqrHJnjiMIMd1HImG9Z5lC4bLdKxmllBaYWSDZ0z0gF5+lc+hddJVjmZUsirYblnmhCFVBK7KKI+z4wmh1oqlEOhfHsggqd7+GvutJgHg/cuwP5xq5J4lhB3bEAz6rdkPPYTsjcxUb2+k8bz33fDP2HTeqT6cFuxiSQtedmZEVi98+oJbYqt2+cUN5tcaFcZ/HTAe4L+L8eKjYXuUxDFact6WdygGrB3BlG1VGKuol+Doi/36lQoZk9KJcmSbIwt9kHVy88MSqOFJ0r6nN34PQ8BBjbdL3c+ZCWifwwgq98S1YCxoeDlBlR4v54BYLu25OwL4EzCGTlv4Buoc9h4BmliCIURq3NrkRxEMXzyQGsTwm0ep94tyzzNk6bpQhKgAWmXQI8hRbJ0jDpiXBccvVBnt88rtdnxi8mcjN+BoxDxq7MhQaE=----ATTACHMENT:----MjYyMjYzMDM4OTA5Nzc1MiAyNDM2ODU3NDY2MDYwMjIyIDI3MjczNTQxMTc0NDIzNjg=