'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:----toDZtRG7P9b5Cqm7oqStgsjYBwpI0BtDY4Lww4kUTE4z/oMcnXWHFFnL9NqesRgLkq57smkt8vurg5ifbZKCxHmK+T6vz3JLYkSnWOO+JLbVR/G06iB6jtXWJ0mFRMrIdzoLkSv7EJGs4wAUNLPgvopcvaK7z9YR3xv7DelfnWRUmmJDbiyu1yUHXee6c8OTgOcx6mT38YkKP4AwihDnXCpHD/fEA9Xu+4ZQEkhrsULOpgKyhWVlQBpvdaVni2BI1+bOynFJgH5mArrP/uv6JuIMqqFjiKv79i1kMG1oTWL+4STBklp6Ld4t8RVc40BZPnISyRmsINE1IK/VPfALnm18hMlApPp9Ou7LQI5lrytmIiRtFuRlbFlmQan6qKHLvWA0jxSDOMxB/gQQPqtQJR9LcAmtpG6+8OzeRPMXwy/qSIQeU4pPU8aMqxv7abyz6TXZVShYtagbCO3m7Jf2urUPIxO/ZJLGYTf0oMIkELHb9wSPY2bHlUKcFzh1VyhlKyoIbV/f1leNkYcwtwpuJwU3gFlaYcZHPWgQdWlKY8FE9DDEbAzZCz26dums3hEuol/9Bg3buzuO6i6vsNDwN3gS9szGiE5MOJVuEBJrAmyaVv3Hx08Gc67gQHGdhKad54OUptsztR1aDEJf2GMTqxcntgopaC6YvEv8K1maH5A=----ATTACHMENT:----NTg5NTE1MDkxMDIyNDI5NSA5MzUyMTc5NjQ1NjQ0NTg4IDg0NjExODgzNzg0ODMwMzM=