'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:----K9UfleW2Ortwm0EFEHa2w+q3YIw7IgqbGqDPRtE3tGPLMo9LHX0AHCsnTR0Zjl/gn2ySHZfQ9bl72N277oEus5qYT4Ow31P1u4ZVxAa9B6U9Hjp1pet7a+SnmFk4+vmCahRyGpnY+SNWZPPWCub727DcExE62Y5a6UuAMUFkDKm5H/WS2ESrKBTmxIG5XfJyKKx2qWyqBCKldoK+b3q0tR2UWT96oMmINHDQyx7gNSRFQ6lAcQ4rnQ8R5r93rnaXeCfi/OWZA2I5LC1lbU9pUo7DXFr5EodQjLT+pu9WY5/paXENGmk/paH2150eSq+BmOaaLGTq5OfS77ItvAmybcifwKo6Y5TmYrOHaZK0MRkszWZ7xLFM/RwZbFwJLdq5TGeUlfN0Ji4uo2AJmF1tDQEDHQcnj3o/DQcBnEwz7srWrRfIw78YSDhAk3uajk1O4VmjxZqZes0MofuzS6QPxjYRk2iX9l6VffhQzXWr6edOmmfYinbQuunMFgqZ+rkd/lagbVhy4d0On1rpoNB92g33Uh0arpLS3g+wkBI4jSn66cDRb8UfqsndP/5PS7kkTso2va/xpCFUJdqVrDNLK41jJk8hI/XqTzGSmJ2mZB7hCTEIE6z5AeeYQkqgbkpAgO8g59zRoskqf6/QmWP1qJhPoRBATnLvxE0APKT3gPY=----ATTACHMENT:----NDQ4NTQzNDQwMTU1MzAyNCAzODkxNTM0MTIyNjY3MzQ4IDc1MDg1NjU3NjY2ODg1MDU=